Posted By

ef on 02/22/11


Tagged

mail partial symfony


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

shanford


Send HTML mail with view partial from Symfony task


 / Published in: Symfony
 

  1. $mailer = sfContext::getInstance()->getMailer();
  2. sfContext::getInstance()->getConfiguration()->loadHelpers(array('Partial'));
  3.  
  4. $message = $mailer->compose(array('sender@test.pl' => 'Test mail'),
  5. 'receiver@test.com',
  6. 'Test');
  7.  
  8. $message->setBody(get_partial('global/userMailPartial'), 'text/html');
  9. $mailer->send($message);

Report this snippet  

You need to login to post a comment.