[dancer-users] How to use HTML template as body to an Email?

Rick Leir richard.leir at canadiana.ca
Wed Jan 27 14:45:56 GMT 2016


There were threads on this recently, I posted config, Perl and tt. There
are a few gotchas but it is quite do-able. What error do you see?

http://lists.preshweb.co.uk/pipermail/dancer-users/2016-January/005429.html
http://lists.preshweb.co.uk/pipermail/dancer-users/2016-January/005448.html
cheers -- Rick


> I am trying to send an email as HTML using HTML template. Does anybody know
> that how can I use HTML template (that resides in view directory) as email
> body? So far I tried the following code but am not able to get it working.
> It may be not the right way of doing it.
>
> try {
>     email {
>         from => 'abc at xyz.com',
>         to => 'xyz at abc.com',
>         subject => 'test email',
>         body => template 'contactUsEmail.tt', {name => $params->{'name'},
> email => $params->email'}, message => $params->{'message'}},
>         type => 'html'
>     };
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.preshweb.co.uk/pipermail/dancer-users/attachments/20160127/51866dee/attachment.html>


More information about the dancer-users mailing list