public function MailEntity::__construct in Simplenews 3.x
Same name and namespace in other branches
- 8.2 src/Mail/MailEntity.php \Drupal\simplenews\Mail\MailEntity::__construct()
- 8 src/Mail/MailEntity.php \Drupal\simplenews\Mail\MailEntity::__construct()
Constructs a MailEntity object.
File
- src/
Mail/ MailEntity.php, line 64
Class
- MailEntity
- Default mail class for entities.
Namespace
Drupal\simplenews\MailCode
public function __construct(ContentEntityInterface $issue, SubscriberInterface $subscriber, MailCacheInterface $mail_cache) {
$this->subscriber = $subscriber;
$this->issue = $issue;
if ($this->issue
->hasTranslation($this
->getLanguage())) {
$this->issue = $this->issue
->getTranslation($this
->getLanguage());
}
$this->cache = $mail_cache;
$this->newsletter = $issue->simplenews_issue->entity;
}