You are here

function _subscriptions_mail_mail_edit_text in Subscriptions 2.0.x

Same name and namespace in other branches
  1. 7 subscriptions_mail.mail_edit.inc \_subscriptions_mail_mail_edit_text()

Implements hook_mail_edit_text().

Provide default templates for mail_edit.

Parameters

$mailkey:

$language:

Return value

array

1 call to _subscriptions_mail_mail_edit_text()
subscriptions_mail_mail_edit_text in subscriptions_mail/subscriptions_mail.module
Implements hook_mail_edit_text().

File

subscriptions_mail/subscriptions_mail.mail_edit.inc, line 20
Subscriptions_mail module integration with Mail Editor module.

Code

function _subscriptions_mail_mail_edit_text($mailkey, $language) {
  $langcode = $language->language;
  _subscriptions_mail_module_load_include('templates.inc');
  switch ($mailkey) {
    case '.DEFAULT':
      $return = array(
        'subject' => subscriptions_mail_template('SUBJ', $langcode),
        'body' => subscriptions_mail_template('BODY', $langcode),
        'subscriptions_comment_body' => subscriptions_mail_template('CITEM', $langcode),
      );
      break;
    case 'digest':
      $return = array(
        'subject' => subscriptions_mail_template('DSUBJ', $langcode),
        'body' => subscriptions_mail_template('DBODY', $langcode),
      );
      break;
    default:
      $return = _mail_edit_load('subscriptions_mail_.DEFAULT', $langcode, TRUE);
      unset($return['default'], $return['language'], $return['type']);
  }
  $return['always'] = TRUE;
  return $return;
}