Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
fiSCIENCES opened this issue Oct 2, 2024 · 2 comments
Open

Comments

@fiSCIENCES
Copy link

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
Copy link
Member

greeflas commented Oct 2, 2024

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
Copy link
Author

fiSCIENCES commented Oct 2, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants