Skip to content

Commit

Permalink
Update EmailMessage.php
Browse files Browse the repository at this point in the history
  • Loading branch information
usernane authored Jul 17, 2022
1 parent e51b4df commit 3495699
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions webfiori/email/EmailMessage.php
Original file line number Diff line number Diff line change
Expand Up @@ -545,6 +545,28 @@ public function setSubject(string $subject) {
$this->subject = $trimmed;
}
}
/**
* 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 $lang 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->contentLang = $langU;
$this->getDocument()->setLanguage($langU);

return true;
}

return false;
}
private function _addAddress(string $address, string $name = null, string $type = 'to') {
$nameTrimmed = $this->_trimControlChars(str_replace('<', '', str_replace('>', '', $name)));
$addressTrimmed = $this->_trimControlChars(str_replace('<', '', str_replace('>', '', $address)));
Expand Down

0 comments on commit 3495699

Please sign in to comment.