function hook_mail_edit_token_types in Mail Editor 8
Same name and namespace in other branches
- 2.0.x mail_edit.api.php \hook_mail_edit_token_types()
Token types that may be used in the token browser while editing an email.
This is more of a special function than a hook, it is only called when editing an email.
Parameters
string $template_name: The machine name of the email template being edited.
Return value
array A list of each token type that can be used in emails and by the token browser from the Token module. The 'user' token type will always be available.
1 invocation of hook_mail_edit_token_types()
- MailEditTemplateForm::buildForm in src/
Form/ MailEditTemplateForm.php - Form constructor.
File
- ./
mail_edit.api.php, line 68 - Documentation of the hooks provided by Mail Edit.
Code
function hook_mail_edit_token_types($template_name) {
if ($template_name == 'new_order_notification') {
return [
'commerce_order',
'commerce_product',
];
}
}