You are here

function spam_mail_body in Spam 5

Generate an appropriate notification mail message

1 call to spam_mail_body()
spam_default_actions in ./spam.module
The default callback, performs all actions on spam/not spam content.

File

./spam.module, line 2235

Code

function spam_mail_body($type, $header, $body, $id) {
  global $base_url;
  switch ($type) {
    case 'comment':
      return t("Hello @adminname.\n\n  A @type recently posted to your '@sitename' website has been automatically marked as spam.  The text of the spam @type is as follows:\n\n<spam>\nSubject: @title\n\n@body\n\n  Edit the @type here: @editurl\n  View all spam @types here: @allurl", array(
        '@adminname' => $admin->name,
        '@types' => $type . 's',
        '@type' => $type,
        '@sitename' => variable_get('site_name', 'drupal'),
        '@title' => $header,
        '@body' => $body,
        '@editurl' => $base_url . url("{$type}/edit/{$id}"),
        '@allurl' => $base_url . url("admin/content/{$type}/list/spam"),
      ));
    case 'node':
      return t("Hello @adminname.\n\n  A @type recently posted to your '@sitename' website has been automatically marked as spam.  The text of the spam @type is as follows:\n\n<spam>\nSubject: @title\n\n@body\n\n  Edit the @type here: @editurl\n  View all spam @types here: @allurl", array(
        '@adminname' => $admin->name,
        '@types' => $type . 's',
        '@type' => $type,
        '@sitename' => variable_get('site_name', 'drupal'),
        '@title' => $header,
        '@body' => $body,
        '@editurl' => $base_url . url("{$type}/{$id}/edit"),
        '@allurl' => $base_url . url("admin/content/{$type}/list/spam"),
      ));
    default:
      return t("Hello @adminname.\n\n  @type content recently posted to your '@sitename' website has been automatically marked as spam.  The text of the spam content is as follows:\n\n<spam>\nSubject: @title\n\n@body\n", array(
        '@adminname' => $admin->name,
        '@type' => $type,
        '@sitename' => variable_get('site_name', 'drupal'),
        '@title' => $header,
        '@body' => $body,
      ));
  }
}