You are here

function MailEntity::getLanguage in Simplenews 8

Same name and namespace in other branches
  1. 8.2 src/Mail/MailEntity.php \Drupal\simplenews\Mail\MailEntity::getLanguage()
  2. 3.x src/Mail/MailEntity.php \Drupal\simplenews\Mail\MailEntity::getLanguage()

The language that should be used for this newsletter mail.

Return value

string The langcode.

Overrides MailInterface::getLanguage

5 calls to MailEntity::getLanguage()
MailEntity::build in src/Mail/MailEntity.php
Build the entity object.
MailEntity::buildBody in src/Mail/MailEntity.php
Build the themed newsletter body.
MailEntity::getBodyWithFormat in src/Mail/MailEntity.php
Get the body with the requested format.
MailEntity::getSubject in src/Mail/MailEntity.php
Returns the mail subject.
MailEntity::setEntity in src/Mail/MailEntity.php
Set the entity of this mail.

File

src/Mail/MailEntity.php, line 223

Class

MailEntity
Default mail class for entities.

Namespace

Drupal\simplenews\Mail

Code

function getLanguage() {
  return $this
    ->getSubscriber()
    ->getLangcode();
}