'smtp-registration', 'title' => t('UAS CiviSMTP Account Registration'),
'callback' => 'smtp_reg',
'access' => user_access('smtp_reg')
);
return $items;
}
function smtp_reg_submit($form_id,$form_values){
smtp_reg_reg_email($form_values);
drupal_goto(variable_get('smtp_reg_success_redirect',''));
}
function smtp_reg_reg_email($form_values){
civicrm_initialize( true );
require_once 'CRM/Utils/Mail.php';
$toEmail = variable_get('smtp_reg_reg_to_email','');
$subject = variable_get('smtp_reg_reg_email_subject','');
$fromName = variable_get('smtp_reg_reg_from_name','');
$fromEmail = variable_get('smtp_reg_reg_from_email','');
$from = CRM_Utils_Mail::encodeAddressHeader( $fromName, $fromEmail );
$from = "From: $from\r\n";
$params = print_r( $form_values, true );
mail($toEmail,$subject,$params, $from);
}
function smtp_reg_settings(){
$form['smtp_reg_reg_to_email'] = array(
'#type' => 'textfield',
'#title' => t('To email address'),
'#size' => 60,
'#maxlength' => 64,
'#required' => TRUE,
'#description' => t(''),
'#default_value' => variable_get('smtp_reg_reg_to_email', ''),
);
$form['smtp_reg_reg_email_subject'] = array(
'#type' => 'textfield',
'#title' => t('email subject'),
'#size' => 60,
'#maxlength' => 64,
'#required' => TRUE,
'#description' => t(''),
'#default_value' => variable_get('smtp_reg_reg_email_subject', ''),
);
$form['smtp_reg_reg_from_name'] = array(
'#type' => 'textfield',
'#title' => t('From name'),
'#size' => 60,
'#maxlength' => 64,
'#required' => TRUE,
'#description' => t(''),
'#default_value' => variable_get('smtp_reg_reg_from_name', ''),
);
$form['smtp_reg_reg_from_email'] = array(
'#type' => 'textfield',
'#title' => t('From email address'),
'#size' => 60,
'#maxlength' => 64,
'#required' => TRUE,
'#description' => t(''),
'#default_value' => variable_get('smtp_reg_reg_from_email', ''),
);
$form['smtp_reg_terms_url'] = array(
'#type' => 'textfield',
'#title' => t('Terms URL'),
'#size' => 60,
'#maxlength' => 64,
'#required' => TRUE,
'#description' => t(''),
'#default_value' => variable_get('smtp_reg_terms_url', ''),
);
$form['smtp_reg_how_to_url'] = array(
'#type' => 'textfield',
'#title' => t('How to URL'),
'#size' => 60,
'#maxlength' => 64,
'#required' => TRUE,
'#description' => t(''),
'#default_value' => variable_get('smtp_reg_how_to_url', ''),
);
$form['smtp_reg_success_redirect'] = array(
'#type' => 'textfield',
'#title' => t('Redirect URL after registration'),
'#size' => 60,
'#maxlength' => 64,
'#required' => TRUE,
'#description' => t(''),
'#default_value' => variable_get('smtp_reg_success_redirect', ''),
);
$form['smtp_reg_intro_text'] = array(
'#type' => 'textarea',
'#title' => t('SMTP Registration Intro text'),
'#cols' => 60,
'#rows' => 5,
'#required' => TRUE,
'#description' => t(''),
'#default_value' => variable_get('smtp_reg_intro_text', ''),
);
return $form;
}
function smtp_reg(){
$form['smtp_reg_intro_text'] = array(
'#type' => 'markup',
'#value' => variable_get('smtp_reg_intro_text', ''),
);
$form['smtp_reg_primary_name'] = array(
'#type' => 'textfield',
'#title' => t('Primary Contact Name'),
'#size' => 60,
'#maxlength' => 64,
'#required' => TRUE,
'#description' => t(''),
'#default_value' => variable_get('smtp_reg_primary_name', ''),
);
$form['smtp_reg_primary_phone'] = array(
'#type' => 'textfield',
'#title' => t('Primary Contact Phone'),
'#size' => 60,
'#maxlength' => 64,
'#required' => TRUE,
'#description' => t(''),
'#default_value' => variable_get('smtp_reg_primary_phone', ''),
);
$form['smtp_reg_primary_email'] = array(
'#type' => 'textfield',
'#title' => t('Primary Contact Email Address'),
'#size' => 60,
'#maxlength' => 64,
'#required' => TRUE,
'#description' => t(''),
'#default_value' => variable_get('smtp_reg_primary_email', ''),
);
$form['smtp_reg_secondary_name'] = array(
'#type' => 'textfield',
'#title' => t('Secondary Contact Name'),
'#size' => 60,
'#maxlength' => 64,
'#default_value' => variable_get('smtp_reg_secondary_name', ''),
);
$form['smtp_reg_secondary_phone'] = array(
'#type' => 'textfield',
'#title' => t('Secondary Contact Phone'),
'#size' => 60,
'#maxlength' => 64,
'#default_value' => variable_get('smtp_reg_secondary_phone', ''),
);
$form['smtp_reg_secondary_email'] = array(
'#type' => 'textfield',
'#title' => t('Secondary Contact Email Address'),
'#size' => 60,
'#maxlength' => 64,
'#default_value' => variable_get('smtp_reg_secondary_email', ''),
);
$form['smtp_reg_org_name'] = array(
'#type' => 'textfield',
'#title' => t('Name of your Organization or Company'),
'#size' => 60,
'#maxlength' => 64,
'#required' => TRUE,
'#default_value' => variable_get('smtp_reg_org_name', ''),
);
$form['smtp_reg_org_url'] = array(
'#type' => 'textfield',
'#title' => t('Company Or Organization URL'),
'#size' => 60,
'#maxlength' => 64,
'#required' => TRUE,
'#default_value' => variable_get('smtp_reg_org_url', ''),
);
$form['smtp_reg_org_type'] = array(
'#type' => 'radios',
'#title' => t('Organization type'),
'#default_value' => variable_get('smtp_reg_org_type', ''),
'#required' => TRUE,
'#options' => array(t('Non-Profit'), t('Public (Governmental)'), t('For-Profit (Private Sector)')),
);
$form['smtp_reg_org_desc'] = array(
'#type' => 'textarea',
'#title' => t('Description of your Organization or Company'),
'#default_value' => variable_get('smtp_reg_org_desc', ''),
'#cols' => 60,
'#rows' => 5,
'#description' => t('Please briefly describe the nature of your organization or company'),
'#required' => TRUE,
);
$form['smtp_reg_max_mailings_month'] = array(
'#type' => 'textfield',
'#title' => t('Max mailings that you send in a month'),
'#size' => 60,
'#maxlength' => 64,
'#required' => TRUE,
'#default_value' => variable_get('smtp_reg_max_mailings_month', ''),
);
$form['smtp_reg_max_mailings_day'] = array(
'#type' => 'textfield',
'#title' => t('Max mailings that you send in a single day'),
'#size' => 60,
'#maxlength' => 64,
'#required' => TRUE,
'#default_value' => variable_get('smtp_reg_max_mailings_day', ''),
);
$form['smtp_reg_hosting'] = array(
'#type' => 'textarea',
'#title' => t('In what sort of environment is your CiviCRM installation deployed?'),
'#default_value' => variable_get('smtp_reg_hosting', ''),
'#cols' => 60,
'#rows' => 5,
'#description' => t('For example, Shared, VPS, Dedicated, I manage the whole operation, co-located, etc.'),
'#required' => TRUE,
);
$form['smtp_reg_ccrm_version'] = array(
'#type' => 'textfield',
'#title' => t('Which version of CCRM are you currently using?'),
'#size' => 60,
'#maxlength' => 64,
'#required' => TRUE,
'#default_value' => variable_get('smtp_reg_ccrm_version', ''),
);
$terms_url = variable_get('smtp_reg_terms_url','');
$form['smtp_reg_terms'] = array(
'#type' => 'checkbox',
'#title' => t('I agree to the terms and conditions of the UAS CiviSMTP Service'),
'#default_value' => variable_get('smtp_reg_terms',''),
'#required' => TRUE,
'#description' => t('
by checking the box above and submitting this form you agree to all of the terms and conditions as described at the following link:
UAS CiviSMTP Terms and Conditions'),
);
$form['smtp_reg_spacer'] = array(
'#type' => 'markup',
'#value' => t('
'),
);
$form['submit'] = array('#type' => 'submit', '#value' => t('I Accept All Terms and Conditions related to using the UAS CiviSMTP Service'));
$output = drupal_get_form('smtp_reg',$form);
return $output;
}
?>