Send HTML mail with view partial from Symfony task


/ Published in: Symfony
Save to your folder(s)



Copy this code and paste it in your HTML
  1. $mailer = sfContext::getInstance()->getMailer();
  2. sfContext::getInstance()->getConfiguration()->loadHelpers(array('Partial'));
  3.  
  4. $message = $mailer->compose(array('[email protected]' => 'Test mail'),
  5. 'Test');
  6.  
  7. $message->setBody(get_partial('global/userMailPartial'), 'text/html');
  8. $mailer->send($message);

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.