yiimaker / yii2-email-templates

Extension for creating email templates and manage using your site dashboard
BSD 3-Clause "New" or "Revised" License
93 stars 20 forks source link

How do we force a language selection from template selection/parse? #88

Open fiSCIENCES opened 1 day ago

fiSCIENCES commented 1 day ago

Hello,

For testing purpose (i.e. send an email with all languages results to check them):

    $template = Yii::$app->get('templateManager')->getTemplate($templateName);
    $template->parse([['subject'...],['body'...]], ??LANGUAGE??);

Thank you,

greeflas commented 1 day ago

Hi,

you can provide language as second argument of getTemplate() method:

$template = Yii::$app->get('templateManager')->getTemplate($templateName, $neededLanguage);

More details in doc: https://github.com/yiimaker/yii2-email-templates/blob/master/docs/guide/template-manager.md#template-manager-methods

fiSCIENCES commented 1 day ago

Great!

And thank you for the fix!

Cordialement, https://www.fisciences.com/
Martin Pineault iConsultant (analyste/programmeur) Développement f.i.SCIENCES inc. m: 418-808-4839 w: www.fisciences.com https://www.fisciences.com/ https://ca.linkedin.com/in/martinpineault https://www.claris.com/partners/profile/company.10000007774/?lang=fr

Le 2 oct. 2024 à 16:59, Volodymyr Kupriienko @.***> a écrit :

Hi,

you can provide language as second argument of getTemplate() method:

$template = Yii::$app->get('templateManager')->getTemplate($templateName, $neededLanguage);

More details in doc: https://github.com/yiimaker/yii2-email-templates/blob/master/docs/guide/template-manager.md#template-manager-methods

— Reply to this email directly, view it on GitHub https://github.com/yiimaker/yii2-email-templates/issues/88#issuecomment-2389685977, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHJMKJS675NZJZ6ERMYUNKTZZRNCLAVCNFSM6AAAAABPIMYSGGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGOBZGY4DKOJXG4. You are receiving this because you authored the thread.