Index: /Users/achieveinternet/Sites/mansueto_local/sites/all/modules/flag_content/flag_content.module =================================================================== --- /Users/achieveinternet/Sites/mansueto_local/sites/all/modules/flag_content/flag_content.module (revision 3490) +++ /Users/achieveinternet/Sites/mansueto_local/sites/all/modules/flag_content/flag_content.module (working copy) @@ -7,6 +7,7 @@ define('FLAG_CONTENT_PERM_ADD', 'flag content'); define('FLAG_CONTENT_PERM_MANAGE', 'manage flagged list'); define('FLAG_CONTENT_EMAIL', 'flag_content_email'); +define('FLAG_CONTENT_EMAIL_NOTIFICATIONS', 'email_notifications'); define('FLAG_CONTENT_USER', 'flag_content_user'); define('FLAG_CONTENT_COMMENT', 'flag_content_comment'); define('FLAG_CONTENT_TYPE_NODE', 'node'); @@ -98,7 +99,15 @@ '#return_value' => 1, '#default_value' => variable_get(FLAG_CONTENT_COMMENT, 0), ); - + + $form['email'][FLAG_CONTENT_EMAIL_NOTIFICATIONS] = array( + '#type' => 'radios', + '#title' => 'Email Notifications', + '#default_value' => variable_get(FLAG_CONTENT_EMAIL_NOTIFICATIONS, 0), + '#options' => array(t('Yes'),t('No')), + '#description' => t('Allow emails to be sent to the user when an item has been flagged.'), + ); + $form['email'][FLAG_CONTENT_EMAIL] = array( '#type' => 'textfield', '#title' => t('Email address'), @@ -291,10 +300,12 @@ break; } - // Email the admin - $email = theme('flag_content_mail', $entry, $type); - drupal_mail('flag_content_admin', $email['to'], $email['subject'], $email['body'], $email['from']); - + // Email the admin if Email Notification is Yes + if (variable_get(FLAG_CONTENT_EMAIL_NOTIFICATIONS, 0) == 0) { + $email = theme('flag_content_mail', $entry, $type); + drupal_mail('flag_content_admin', $email['to'], $email['subject'], $email['body'], $email['from']); + } + // Log the operation: watchdog('flag content', t("@name flagged item @entry for review.", array ('@name' => theme('placeholder', $user->name ." <" . $email['from'] . ">"), '@entry' => l($title, $path))));