function campaignmonitor_user_form in Campaign Monitor 5.2
Same name and namespace in other branches
- 5 campaignmonitor.module \campaignmonitor_user_form()
- 6 campaignmonitor.module \campaignmonitor_user_form()
- 6.2 campaignmonitor.module \campaignmonitor_user_form()
- 7 modules/campaignmonitor_user/campaignmonitor_user.module \campaignmonitor_user_form()
1 string reference to 'campaignmonitor_user_form'
File
- ./
campaignmonitor.module, line 228
Code
function campaignmonitor_user_form() {
global $user;
// Replace api_key and list_id with your own details
$api_key = variable_get('campaignmonitor_api_key', '');
$list_id = variable_get('campaignmonitor_list_id', '');
$email = $user->mail;
if (_campaignmonitor_is_subscribed($api_key, $list_id, $email, TRUE)) {
$default = TRUE;
}
else {
$default = FALSE;
}
$form['subscribe_newsletter'] = array(
'#type' => 'checkbox',
'#title' => variable_get('campaignmonitor_userpagedisplaytext', 'Newsletter'),
'#default_value' => $default,
);
$form['is_subscribed'] = array(
'#type' => 'hidden',
'#default_value' => $default,
);
$form['submit'] = array(
'#type' => 'submit',
'#value' => t('Save'),
);
return $form;
}