::ManifestReader::JSON;
our $AUTHORITY = 'cpan:YANICK';
# ABSTRACT: Extension of E::M::K::ManifestReader::JSON for Email::MIME::Kit::Bulk
$Email::MIME::Kit::Bulk::ManifestReader::JSON::VERSION = '0.0.
Reader::JSON';
sub read_manifest {
my ($self) = @_;
my $manifest = 'manifest.json';
if ($self->kit->has_language) {
$manifest = 'manifest.' . $self->kit->language . '.json';
}
my $json_ref = $self->kit->kit_reader->get_kit_entry($manifest);
my $content = JSON->new->decode($$json_ref);
}
__PACKAGE__->meta->make_immutable;
no Moose;
1;
__END__
=pod
=encoding
::Kit::Bulk::ManifestReader::JSON;
use Moose;
extends 'Email::MIME::Kit';
has '+_manifest_reader_seed' => (
default => '=Email::MIME::Kit::Bulk::ManifestReader::JSON',
);
has language => (
::Kit>. It defaults the C<manifest_reader>
attribute to L<Email::MIME::Kit::Bulk::ManifestReader::JSON>, and add a new
C<language> attribute.
=head1 AUTHORS
=over 4
=item *
Jesse Luehrs <doy@c
s;
use MooseX::App::Simple;
use Email::MIME::Kit::Bulk;
use Email::MIME::Kit::Bulk::Target;
use JSON;
use MooseX::Types::Path::Tiny qw/ Path /;
use PerlX::Maybe;
option kit => (
is => 'ro
=> 'ro',
isa => Path,
lazy => 1,
default => sub { shift->kit->child('targets.json') },
);
sub BUILD {
my $self = shift;
die 'Kit directory must have a manifest'
rep {
my $f = $_->basename;
$f =~ /^manifest\./ && $f =~ /\.json$/
} $self->kit->children;
die 'Cannot find target specification (' . $self->_
@parts,
],
);
}
# XXX Email::MIME::Kit reads the manifest.json file as latin1
# fix this in a better way once that is fixed?
my $subject = $email->heade
>.json> to generate its associated email. If no language
is given, the regular C<manifest.json> will be used instead.
If C<emk_bulk> is used, it'll look in the I<kit> directory for a
C<targets.json>
file, which it'll use to create the email targets.
The format of the C<targets.json> file is a simple serialization of
the L<Email::MIME::Kit::Bulk::Target> constructor arguments:
[
{