send newsletter working through API for one adress
This commit is contained in:
parent
08323f4a02
commit
4f6e32bfaa
4 changed files with 9 additions and 7 deletions
|
|
@ -56,19 +56,19 @@ return [
|
|||
foreach ($recipients as $recipient) {
|
||||
try {
|
||||
|
||||
$mailersend = new MailerSend();
|
||||
$mailersend = new MailerSend(['api_key' => kirby()->option('mailerSendApiKey')]);
|
||||
|
||||
$recipients = [
|
||||
new Recipient($recipient),
|
||||
new Recipient($recipient, 'abonné'),
|
||||
];
|
||||
|
||||
$emailParams = (new EmailParams())
|
||||
->setFrom('info@actuel-inactuel.com')
|
||||
->setFrom('info@actuel-inactuel.fr')
|
||||
->setFromName('actuel-inactuel')
|
||||
->setRecipients($recipients)
|
||||
->setSubject($subject)
|
||||
->setHtml($emailPage->body())
|
||||
->setReplyTo('info@actuel-inactuel.com')
|
||||
->setReplyTo('info@actuel-inactuel.fr')
|
||||
->setReplyToName('actuel-inactuel');
|
||||
|
||||
$mailersend->email->send($emailParams);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue