|
|
|
|
|
|
|
|
bool $addLinkOrderWhenNoDistribution = false |
|
|
bool $addLinkOrderWhenNoDistribution = false |
|
|
): Email |
|
|
): Email |
|
|
{ |
|
|
{ |
|
|
|
|
|
$linkProducer = ''; |
|
|
|
|
|
if($producer) { |
|
|
|
|
|
$linkProducer = 'https://'.$producer->slug.'.souke.fr'; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
$messageAutoText = '' ; |
|
|
$messageAutoText = '' ; |
|
|
$messageAutoHtml = '' ; |
|
|
$messageAutoHtml = '' ; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
' ; |
|
|
' ; |
|
|
$messageAutoHtml .= '<br /><br />' ; |
|
|
$messageAutoHtml .= '<br /><br />' ; |
|
|
|
|
|
|
|
|
$linkOrder = $this->distributionSolver->getLinkOrder($distribution); |
|
|
|
|
|
|
|
|
$linkOrder = $linkProducer.'/order/order?date='.$distribution->date; |
|
|
$dateOrder = strftime('%A %d %B %Y', strtotime($distribution->date)) ; |
|
|
$dateOrder = strftime('%A %d %B %Y', strtotime($distribution->date)) ; |
|
|
$messageAutoHtml .= '<a href="'.$linkOrder.'">Passer ma commande du '.$dateOrder.'</a>' ; |
|
|
$messageAutoHtml .= '<a href="'.$linkOrder.'">Passer ma commande du '.$dateOrder.'</a>' ; |
|
|
$messageAutoText .= 'Suivez ce lien pour passer votre commande du '.$dateOrder.' : |
|
|
$messageAutoText .= 'Suivez ce lien pour passer votre commande du '.$dateOrder.' : |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
else { |
|
|
else { |
|
|
if($addLinkOrderWhenNoDistribution) { |
|
|
if($addLinkOrderWhenNoDistribution) { |
|
|
$linkOrder = \Yii::$app->urlManagerProducer->createAbsoluteUrl([ |
|
|
|
|
|
'order/order', |
|
|
|
|
|
'slug_producer' => $this->getProducerContext()->slug |
|
|
|
|
|
]) ; |
|
|
|
|
|
|
|
|
$linkOrder = $linkProducer.'/order/order'; |
|
|
$messageAutoHtml .= '<a href="'.$linkOrder.'">Passer ma commande</a>' ; |
|
|
$messageAutoHtml .= '<a href="'.$linkOrder.'">Passer ma commande</a>' ; |
|
|
$messageAutoText .= 'Suivez ce lien pour passer votre commande : |
|
|
$messageAutoText .= 'Suivez ce lien pour passer votre commande : |
|
|
'.$linkOrder ; |
|
|
'.$linkOrder ; |
|
|
|
|
|
|
|
|
$fromEmail = $this->producerSolver->getProducerEmailPlatform($producer) ; |
|
|
$fromEmail = $this->producerSolver->getProducerEmailPlatform($producer) ; |
|
|
$fromName = $producer->name ; |
|
|
$fromName = $producer->name ; |
|
|
|
|
|
|
|
|
$linkProducer = 'https://'.$producer->slug.'.souke.fr'; |
|
|
|
|
|
$linkUnsubscribe = $linkProducer.'/newsletter/unsubscribe'; |
|
|
$linkUnsubscribe = $linkProducer.'/newsletter/unsubscribe'; |
|
|
|
|
|
|
|
|
// Message inscription newsletter |
|
|
// Message inscription newsletter |