Y
Y
YakutD2019-01-26 16:32:11
PHP
YakutD, 2019-01-26 16:32:11

How to combine twig and phpmailer?

Hello, I'm trying to make an html email using twig, but I always get an empty body error. What am I doing wrong? Here is the code:
$mail->msgHTML($app->render('email.html'));

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
grinat, 2019-01-26
@grinat

This is probably how it should be:
$mail->Body = $mail->msgHTML($app->render('email.html'));
$mail->IsHTML(true);
or $app->render('email.html') returns null

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question