You are here

function simplenews_subscription_confirmation_text in Simplenews 7.2

Same name and namespace in other branches
  1. 7 simplenews.module \simplenews_subscription_confirmation_text()

Generate default and custom subscription confirmation email text.

Parameters

string $key: Text identification key.

Return value

Invitation text.

5 calls to simplenews_subscription_confirmation_text()
simplenews_admin_settings_subscription in includes/simplenews.admin.inc
Menu callback: Simplenews admin settings - Subscription.
simplenews_build_combined_mail in includes/simplenews.mail.inc
Build subject and body of the subscribe confirmation email.
simplenews_build_subscribe_mail in includes/simplenews.mail.inc
Build subject and body of the subscribe confirmation email.
simplenews_build_unsubscribe_mail in includes/simplenews.mail.inc
Build subject and body of the unsubscribe confirmation email.
simplenews_confirmation_get_changes_list in ./simplenews.module
Converts an array of subscription changes into descriptions.

File

./simplenews.module, line 2307
Simplenews node handling, sent email, newsletter block and general hooks

Code

function simplenews_subscription_confirmation_text($key) {
  $text = variable_get('simplenews_confirm_' . $key, FALSE);

  // If administrator did not change the text, the variable is empty.
  // We get the default here.
  if (!$text) {
    switch ($key) {
      case 'subscribe_unsubscribed':
        $text = t("We have received a request to subscribe [simplenews-subscriber:mail] to the [simplenews-newsletter:name] newsletter on [site:name] website at [site:url]. To confirm please use the link below.\n\n[simplenews-subscriber:subscribe-url]");
        break;
      case 'subscribe_subscribed':
        $text = t("We have received a request to subscribe [simplenews-subscriber:mail] to the [simplenews-newsletter:name]  newsletter on [site:name] website at [site:url]. However, this email is already subscribed to this newsletter. If you intended to unsubscribe please visit our site: [site:url]");
        break;
      case 'unsubscribe_subscribed':
        $text = t("We have received a request to remove the [simplenews-subscriber:mail] from the [simplenews-newsletter:name] mailing list on [site:name] website at [site:url]. To confirm please use the link below.\n\n[simplenews-subscriber:unsubscribe-url]");
        break;
      case 'unsubscribe_unsubscribed':
        $text = t("We have received a request to remove the [simplenews-subscriber:mail] from the [simplenews-newsletter:name] mailing list on [site:name] website at [site:url]. However, this email is not subscribed to this mailing list. If you intended to subscribe please visit our site at [site:url]");
        break;
      case 'subscribe_subject':
        $text = t("Confirmation for [simplenews-newsletter:name] from [site:name]");
        break;
      case 'combined_subject':
        $text = t('Confirmation for [site:name]');
        break;
      case 'combined_body':
        $text = t("We have received a request for the following subscription changes for [simplenews-subscriber:mail] at [site:url]:\n\n[changes-list]\n\nTo confirm please use the link below.\n\n[simplenews-subscriber:combined-url]");
        break;
      case 'combined_body_unchanged':
        $text = t("We have received a request for the following subscription changes for [simplenews-subscriber:mail] at [site:url]:\n\n[changes-list]\n\nNo confirmation necessary because all requested changes equal the current state.");
        break;
      case 'combined_line_subscribe_unsubscribed':
        $text = t('Subscribe to [simplenews-newsletter:name]');
        break;
      case 'combined_line_subscribe_subscribed':
        $text = t('Already subscribed to [simplenews-newsletter:name]');
        break;
      case 'combined_line_unsubscribe_subscribed':
        $text = t('Unsubscribe from [simplenews-newsletter:name]');
        break;
      case 'combined_line_unsubscribe_unsubscribed':
        $text = t('Already unsubscribed from [simplenews-newsletter:name]');
        break;
    }
  }
  return $text;
}