You are here

public function MailEntity::getLanguage in Simplenews 3.x

Same name and namespace in other branches
  1. 8.2 src/Mail/MailEntity.php \Drupal\simplenews\Mail\MailEntity::getLanguage()
  2. 8 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::__construct in src/Mail/MailEntity.php
Constructs a MailEntity object.

File

src/Mail/MailEntity.php, line 204

Class

MailEntity
Default mail class for entities.

Namespace

Drupal\simplenews\Mail

Code

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