<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Hey,<div class=""><br class=""></div><div class="">I use the second solution.</div><div class=""><br class=""></div><div class="">Best regards,</div><div class="">Attila</div><div class=""><br class=""><br class=""><div class=""><div><blockquote type="cite" class=""><div class="">On 26 Jan 2016, at 19:57, Tushar Dave <<a href="mailto:tushardave26@gmail.com" class="">tushardave26@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">Hello Fellow Dancers,<div class=""><br class=""></div><div class="">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. </div><div class=""><br class=""></div><div class="">try {</div><div class=""> email {</div><div class=""> from => '<a href="mailto:abc@xyz.com" class="">abc@xyz.com</a>',</div><div class=""> to => '<a href="mailto:xyz@abc.com" class="">xyz@abc.com</a>',</div><div class=""> subject => 'test email',</div><div class=""> body => template 'contactUsEmail.tt', {name => $params->{'name'}, email => $params->email'}, message => $params->{'message'}},</div><div class=""> type => 'html'</div><div class=""> };</div><div class="">} catch {</div><div class=""> error "Could not send email: $_";</div><div class="">};</div><div class=""><br class=""></div><div class="">Another possible solution that I am thinking of, I can just store the entire HTML code in a scalar variable and use it as email body (e.g. body => $template, where $tempalte contains the HTML code as $template ="html code..").<br class=""></div><div class=""><br class=""></div><div class="">Thanks for the help.</div><div class=""><div class=""><br class=""></div>Best,<br class=""><div class="gmail_signature"><div dir="ltr" class="">Tushar Dave<div class=""><br class=""></div></div></div>
</div></div>
_______________________________________________<br class="">dancer-users mailing list<br class=""><a href="mailto:dancer-users@dancer.pm" class="">dancer-users@dancer.pm</a><br class="">http://lists.preshweb.co.uk/mailman/listinfo/dancer-users<br class=""></div></blockquote></div><br class=""></div></div></body></html>