function mailchimp_subscribe_user($list, $email, $merge_vars, $message = TRUE, $mcapi = NULL) {
$success = FALSE;
if ($mcapi || $mcapi = mailchimp_get_api_object()) {
$double_optin = $list->settings['doublein'];
$success = $mcapi->listSubscribe($list->mc_list_id, $email, $merge_vars, 'html', $double_optin, TRUE);
if ($message && $success && $double_optin) {
drupal_set_message(t('You have chosen to subscribe to %list. An email
will be sent to your address. Click the link in the email to confirm
the subscription.', array('%list' => $list->label)));
}
elseif ($message && $success) {
drupal_set_message(t('You have subscribed to %list.', array('%list' => $list->label)));
}
// clear user cache, just in case there's some cruft leftover
mailchimp_cache_clear_user($list->mc_list_id, $email);
if ($success) {
watchdog('mailchimp', '@email was subscribed to list @list.',
array('@email' => $merge_vars['EMAIL'], '@list' => $list->label), WATCHDOG_NOTICE
);
}
else {
watchdog('mailchimp', 'A problem occurred subscribing @email to list @list. Message: @msg', array(
'@email' => $merge_vars['EMAIL'],
'@list' => $list->label,
'@msg' => $mcapi->errorMessage,
), WATCHDOG_WARNING);
}
}
return $success;
}
As i can see there is no drupal_set_message when user successfully signed up or a problem is occured, only two watchdogs.
Comments
Comment #1
mibfire commentedAs i can see there is no drupal_set_message when user successfully signed up or a problem is occured, only two watchdogs.
Comment #2
mibfire commentedIt was my fault, sorry. Some retard deleted the anonymous user from the database.