Browse Source

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

feature/souke
Guillaume Bourgeois 1 year 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

@@ -174,15 +174,19 @@ Produits disponibles :
$fromEmail = $producerModule->getEmailOpendistrib($producer) ;
$fromName = $producer->name ;

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

// Message inscription newsletter
$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 {
$fromEmail = 'contact@opendistrib.net' ;
@@ -190,9 +194,9 @@ Me désinscrire de ce bulletin d'information :
}

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

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

Loading…
Cancel
Save