1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
| $options = array(
subject' => sfContext::getInstance()->getI18N()->__("[%nomsite%] Notification de commande d une de vos créations", array('%nomsite%' => sfConfig::get('app_nom_site'))),
'fullname' => $artisan->getProfile()->getFullName(),
'email' => $artisan->getProfile()->getUser()->getEmailAddress(),
'parameters' => array(
'nom_artisan' => $artisan->getProfile()->getFullName(),
'num_commande' => $this->getId(),
'nom_site' => sfConfig::get('app_nom_site'),
'url_site' => sfConfig::get('app_url_site'),
'date' => $this->getCreatedAt(),
'basketItem' => $basketItem),
'text' => 'commande/sendConfirmationCommandeArtisanText',
'html' => 'commande/sendConfirmationCommandeArtisanHtml');
$message = ProjectConfiguration::getMailer()->compose();
$message->setSubject($options['subject']);
$message->setBody($this->getPartial($options['html'], $options['parameters']), 'text/html');
$message->addPart($this->getPartial($options['text'], $options['parameters']), 'text/plain');
$address = ArtisanArt::getFromAddress();
$message->setFrom(array($address['email'] => $address['fullname']));
$message->setTo($artisan->getProfile()->getUser()->getEmailAddress());
ProjectConfiguration::getMailer()->send($message); |
Partager