DownloadLetter-Composer-Multilingual
Provides methods useful for composing letters (mail).
Dependency
If you intend to use Czech language, you will also need to install library peterkahl/czech-name-declension.
Usage
use peterkahl\LetterComposer\LetterComposer;
$letterObj = new LetterComposer;
$letterObj->senderNamePlain = 'Customer Service Representative'. PHP_EOL .'Famous Company, Ltd.';
$letterObj->senderNameHtml = 'Customer Service Representative<br>Famous Company, Ltd.';
# Example, Russian
$letterObj->lang = 'ru';
$letterObj->recipientName = '?????? ?????????';
$letterObj->recipientGender = 'f';
echo $letterObj->$letterObj->makeSalutation() . PHP_EOL . PHP_EOL . '??? ??? ????? ??????.' . PHP_EOL . PHP_EOL . $letterObj->makeValedictionPlain();
/*
'????????? ?????? ?????????,
??? ??? ????? ??????.
? ?????????,
Customer Service Representative
Famous Company, Ltd.'
*/
# Example, Czech
$letterObj->lang = 'cs';
$letterObj->recipientName = 'Václav ?tvrtek';
$letterObj->recipientGender = 'm';
echo $letterObj->$letterObj->makeSalutation() . PHP_EOL . PHP_EOL . 'Zde je Va?e nové heslo.' . PHP_EOL . PHP_EOL . $letterObj->makeValedictionPlain();
/*
'Milý Václave ?tvrtku,
Zde je Va?e nové heslo.
S pozdravem,
Customer Service Representative
Famous Company, Ltd.'
*/
|