Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: Need help generating an HTML mail with Email::MIME::Kit

by roboticus (Chancellor)
on Sep 13, 2017 at 12:41 UTC ( #1199298=note: print w/replies, xml ) Need Help??


in reply to Need help generating an HTML mail with Email::MIME::Kit

xMonk:

What sort of difficulties are you having?

...roboticus

When your only tool is a hammer, all problems look like your thumb.

  • Comment on Re: Need help generating an HTML mail with Email::MIME::Kit

Replies are listed 'Best First'.
Re^2: Need help generating an HTML mail with Email::MIME::Kit
by xMonk (Initiate) on Sep 14, 2017 at 00:01 UTC

    Well, I was having problems getting it to work in general.

    I got a bit further yesterday night and ended up with this template manifest.json-file which now takes care of requirements 1 and 2:

    { "renderer": "TestRenderer", "header": [ { "Subject": "MIME e-mail test" }, { "From": "John Doe <john@doe.com.au>" }, { "To": "Jane Doe <jane@doe.com.au>" } ], "alternatives": [ { "attributes": { "content_type": "text/html", "charset": "utf-8" }, "body": "HTML goes <h3>HERE</h3><br>You can also use variables, +like this:<br>E.g. the variable friend = '[% friend %]' and gets rend +ered when the email object is created." } ], "attachments": [ { "type": "application/pdf", "path": "bogus-report.pdf", "attributes": { "filename": "report.pdf" } } ] }

    I still don't know how to load a scalar/hash when creating the "kit". This is how that part of the code is looking right now:

    my $kit = Email::MIME::Kit->new({ source => './dir/where/template/file/is', manifest_reader => 'JSON', }); my $email = $kit->assemble({ friend => 'xMonk', });

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1199298]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (4)
As of 2017-11-25 06:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In order to be able to say "I know Perl", you must have:













    Results (355 votes). Check out past polls.

    Notices?