function commerce_email_language_add in Commerce Email 7
Adds a new language version of an email
Parameters
$lang: The language code for the new email (i.e. EN,FR,DE)
$base_email: Undefined language email object
Return value
array of email subject and content
1 call to commerce_email_language_add()
- commerce_email_list_languages in ./
commerce_email.module - Returns a list of emails in all languages and automatically adds a version for each enabled language
File
- ./
commerce_email.module, line 328 - Defines additional menu item and order html email functonality.
Code
function commerce_email_language_add($lang, $base_email) {
$email_id = db_insert('commerce_email')
->fields(array(
'type' => $base_email->type,
'language' => $lang,
'template' => 0,
'subject' => $base_email->subject,
'content' => $base_email->content,
))
->execute();
}