You are here

function webform_mailchimp_log_subscription in Webform Mailchimp 7.2

Same name and namespace in other branches
  1. 7.4 webform_mailchimp.module \webform_mailchimp_log_subscription()

Log a subscription status to the watchdog table.

Parameters

string $email_address: The email address.

bool $status: If the subscription was successful.

string $error_code: The error code if there was an error.

string $error_message: The error message.

1 call to webform_mailchimp_log_subscription()
webform_mailchimp_webform_submission_insert in ./webform_mailchimp.module
Implements hook_webform_submission_insert().

File

./webform_mailchimp.module, line 186
Webform Mailchimp integrates mailchimp into the webforms module.

Code

function webform_mailchimp_log_subscription($email_address, $status, $error_code = '', $error_message = '') {
  if ($status) {
    watchdog('webform_mailchimp', 'E-mail subscribed: %email', array(
      '%email' => $email_address,
    ), WATCHDOG_INFO);
  }
  else {
    watchdog('webform_mailchimp', 'E-mail not subscribed: %email Error: %error_code <br> %error_message', array(
      '%email' => $email_address,
      '%error_message' => $error_message,
      '%error_code' => $error_code,
    ), WATCHDOG_ERROR);
  }
}