Skip to content

Commit

Permalink
Update EmailMessage.php
Browse files Browse the repository at this point in the history
  • Loading branch information
usernane committed Mar 21, 2023
1 parent 24f68e5 commit 027a231
Showing 1 changed file with 22 additions and 8 deletions.
30 changes: 22 additions & 8 deletions webfiori/email/EmailMessage.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,6 @@ class EmailMessage {
* @since 2.0
*/
private $boundry;
/**
*
* @var string
*
* @since 1.0.5
*/
private $contentLang;
/**
*
* @var HTMLDoc
Expand Down Expand Up @@ -350,7 +343,7 @@ public function getDocument() : HTMLDoc {
* @since 1.0.5
*/
public function getLang() {
return $this->contentLang;
return $this->getDocument()->getLanguage();
}
/**
* Returns an array that contains log messages which are generated
Expand Down Expand Up @@ -533,6 +526,27 @@ public function send() {
throw new SMTPException('Unable to login to SMTP server: '.$server->getLastResponse(), $server->getLastResponseCode());
}
}
/**
* Sets the display language of the email.
*
* The length of the given string must be 2 characters in order to set the
* language code.
*
* @param string $langCode a two characters language code such as AR or EN. Default
* value is 'EN'.
*
*/
public function setLang(string $langCode = 'EN') : bool {
$langU = strtoupper(trim($langCode));

if (strlen($langU) == 2) {
$this->getDocument()->setLanguage($langU);

return true;
}

return false;
}
/**
* Sets the priority of the message.
*
Expand Down

0 comments on commit 027a231

Please sign in to comment.