Frontend\Modules\Mailmotor\Event\NotImplementedSubscribedEvent::getSubscription PHP Method

getSubscription() public method

public getSubscription ( ) : Subscription
return Frontend\Modules\Mailmotor\Command\Subscription
    public function getSubscription()
    {
        return $this->subscription;
    }

Usage Example

 /**
  * On NotImplementedSubscribedEvent
  *
  * @param NotImplementedSubscribedEvent $event
  */
 public function onNotImplementedSubscribedEvent(NotImplementedSubscribedEvent $event)
 {
     // define title
     $title = sprintf(Language::lbl('MailTitleSubscribeSubscriber'), $event->getSubscription()->email, strtoupper($event->getSubscription()->language));
     // define sender/receiver(s)
     $to = $this->modulesSettings->get('Core', 'mailer_to');
     $from = $this->modulesSettings->get('Core', 'mailer_from');
     $replyTo = $this->modulesSettings->get('Core', 'mailer_reply_to');
     // define message
     $message = Message::newInstance($title)->setFrom(array($from['email'] => $from['name']))->setTo(array($to['email'] => $to['name']))->setReplyTo(array($replyTo['email'] => $replyTo['name']))->parseHtml(FRONTEND_CORE_PATH . '/Layout/Templates/Mails/Notification.html.twig', array('message' => $title), true);
     // send mail
     $this->mailer->send($message);
 }
NotImplementedSubscribedEvent