Browse Source

[Administration] Communiquer > envoyer un email : ajout du lien vers la boutique du producteur dans le footer #1492

feature/souke
Guillaume Bourgeois 11 months ago
parent
commit
3efbaadfed
1 changed files with 11 additions and 7 deletions
  1. +11
    -7
      backend/models/MailForm.php

+ 11
- 7
backend/models/MailForm.php View File

$fromEmail = $producerModule->getEmailOpendistrib($producer) ; $fromEmail = $producerModule->getEmailOpendistrib($producer) ;
$fromName = $producer->name ; $fromName = $producer->name ;


$linkProducer = 'https://'.$producer->slug.'.opendistrib.net';
$linkUnsubscribe = Yii::$app->urlManagerProducer->createAbsoluteUrl(['newsletter/unsubscribe', 'slug_producer' => $producer->slug]);

// Message inscription newsletter // Message inscription newsletter
$messageAutoText .= " $messageAutoText .= "


-- --
Boutique : ".$linkProducer."
Me désinscrire : ".$linkUnsubscribe;


Me désinscrire de ce bulletin d'information :
".Yii::$app->urlManagerProducer->createAbsoluteUrl(['newsletter/index', 'slug_producer' => $producer->slug]);

$messageAutoHtml .= "<br /><br />--<br /><br /><a href=\"".Yii::$app->urlManagerProducer->createAbsoluteUrl(['newsletter/unsubscribe', 'slug_producer' => $producer->slug])."\">Me désinscrire</a> de ce bulletin d'information";
$messageAutoHtml .= "<br /><br />--<br>";
$messageAutoHtml .= "Boutique : <a href=\"".$linkProducer."\">".$linkProducer."</a><br>";
$messageAutoHtml .= "Me désinscrire : <a href=\"".$linkUnsubscribe."\">".$linkUnsubscribe."</a>";
} }
else { else {
$fromEmail = 'contact@opendistrib.net' ; $fromEmail = 'contact@opendistrib.net' ;
} }


// Tests // Tests
/*$usersArray = [
['email' => '', 'name' => '', 'lastname' => '']
];*/
$usersArray = [
['email' => 'contact@guillaumebourgeois.fr', 'name' => '', 'lastname' => '']
];


foreach($usersArray as $user) { foreach($usersArray as $user) {
$body['Messages'][] = [ $body['Messages'][] = [

Loading…
Cancel
Save