Browse Source

[Boutique] Newsletter : correctif désinscription

feature/rotating_product
Guillaume Bourgeois 4 months ago
parent
commit
312c0c9c1e
2 changed files with 7 additions and 5 deletions
  1. +5
    -3
      producer/controllers/NewsletterController.php
  2. +2
    -2
      producer/views/newsletter/index.php

+ 5
- 3
producer/controllers/NewsletterController.php View File

return $this->redirectProducerLoginFrontend('unsubscribe'); return $this->redirectProducerLoginFrontend('unsubscribe');
} }


$userModule = $this->getUserModule();
$newsletterManager = $this->getUserModule()->getNewsletterManager();
$userCurrent = $this->getUserCurrent(); $userCurrent = $this->getUserCurrent();
$userModule->unsubscribeUserNewsletter($userCurrent);
//$this->setFlash('success', "<i class=\"bi bi-check2-square\"></i> Votre désinscription a bien été prise en compte, vous ne recevrez plus d'infolettre de la part de ce producteur.");
$newsletterManager->unsubscribeUserNewsletter($userCurrent, Email::TYPE_NEWSLETTER);
$newsletterManager->unsubscribeUserNewsletter($userCurrent, Email::TYPE_ORDER_TAKING);
$this->setFlash('success', "<i class=\"bi bi-check2-square\"></i> Votre désinscription a bien été prise en compte, vous ne recevrez plus d'emails de la part de ce producteur.");

return $this->redirect('index'); return $this->redirect('index');
} }



+ 2
- 2
producer/views/newsletter/index.php View File

[ [
'options' => [ 'options' => [
'data-id' => $user->id, 'data-id' => $user->id,
'data-on' => 'Activé',
'data-off' => 'Désactivé'
'data-on' => 'Activée',
'data-off' => 'Désactivée'
], ],
]) ])
->label('Emails de prise de commande'); ->label('Emails de prise de commande');

Loading…
Cancel
Save