function _campaignmonitor_form_submit in Campaign Monitor 6
Same name and namespace in other branches
- 6.2 campaignmonitor.module \_campaignmonitor_form_submit()
File
- ./
campaignmonitor.module, line 326
Code
function _campaignmonitor_form_submit($form, &$form_state) {
$form_values = $form_state['values'];
if ($form_values['subscribe_newsletter']) {
if ('contact_mail_page' == $form_id) {
$form_values['message'] .= "\n\n" . t('Subscribed to newsletter.');
}
// Replace api_key and list_id with your own details
$api_key = variable_get('campaignmonitor_api_key', '');
$list_id = variable_get('campaignmonitor_list_id', 0);
$email = $form_values['mail'];
$name = $form_values['name'];
_campaignmonitor_add_subscriber($api_key, $list_id, $name, $email);
}
}