function commerce_email_load in Commerce Email 7
Returns an email Subject and Content as an array
Parameters
$email_name: The name of an email to lookup
Return value
array of email subject and content
2 calls to commerce_email_load()
- commerce_email_account_email_send in ./
commerce_email.rules.inc - commerce_email_order_email_send in ./
commerce_email.rules.inc - Rules action: Send the users order as an HTML email
File
- ./
commerce_email.module, line 390 - Defines additional menu item and order html email functonality.
Code
function commerce_email_load($email_name) {
global $language;
$result = db_select('commerce_email')
->fields('commerce_email', array(
'email_id',
'type',
'template',
'subject',
'content',
'language',
))
->condition('type', $email_name)
->condition('language', $language->language)
->execute();
if ($row = $result
->fetchObject()) {
return array(
$row->subject,
$row->content,
);
}
return 0;
}