<div dir="ltr">Hello Fellow Dancers,<div><br></div><div>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><br></div><div>try {</div><div>    email {</div><div>        from => '<a href="mailto:abc@xyz.com">abc@xyz.com</a>',</div><div>        to => '<a href="mailto:xyz@abc.com">xyz@abc.com</a>',</div><div>        subject => 'test email',</div><div>        body => template 'contactUsEmail.tt', {name => $params->{'name'}, email => $params->email'}, message => $params->{'message'}},</div><div>        type => 'html'</div><div>    };</div><div>} catch {</div><div>    error "Could not send email: $_";</div><div>};</div><div><br></div><div>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></div><div><br></div><div>Thanks for the help.</div><div><div><br></div>Best,<br><div class="gmail_signature"><div dir="ltr">Tushar Dave<div><br></div></div></div>
</div></div>