Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

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

by roboticus (Chancellor)
on Sep 13, 2017 at 12:41 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1199298]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (4)
As of 2024-04-25 12:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found