require_once( "../php_include/common.php" );
require_once( "../php_include/mime_mail.inc" );
require_once( "../php_include/smtp_mail.inc" );
$email = cleanPostVariable( 'email' );
$first_name = cleanPostVariable( 'first_name' );
$last_name = cleanPostVariable( 'last_name' );
$degree = cleanPostVariable( 'degree' );
$affiliation = cleanPostVariable( 'affiliation' );
$address = cleanPostVariable( 'address' );
$city = cleanPostVariable( 'city' );
$state = cleanPostVariable( 'state' );
$postal_code = cleanPostVariable( 'postal_code' );
$country = cleanPostVariable( 'country' );
$lists_1 = cleanPostVariable( 'lists_1' );
$lists_2 = cleanPostVariable( 'lists_2' );
$lists_3 = cleanPostVariable( 'lists_3' );
$referrer = cleanPostVariable( 'referrer' );
$referrer_website = cleanPostVariable( 'referrer_website' );
$referrer_other = cleanPostVariable( 'referrer_other' );
$submit = cleanPostVariable( 'submit' );
$errormessage = null;
$this_page = 1;
// ******************************************************************
$smtp_server = "mail.doceus.com";
$default_from_name = "Nurture Your Nature Web site";
$default_from_address = "contact@nurtureyournature.org";
$to = "contact@nurtureyournature.org";
$subject = "Health Care Provider E-mail Signup";
$set_email_from_as_contact_email = false;
$require_email_address = true;
// ******************************************************************
// these next lines are the error messages for all required fields. To make a field not required, remove the 2 lines associated with it below. Don't forget to remove the asterisk on the public form.
if ( $submit != null )
{
if (( $require_email_address ) and ( $email == null ))
$errormessage = "Please provide your e-mail address";
else if (( $email != null ) and ( isValidEmail( $email ) == false ))
$errormessage = "The e-mail address you provided appears to be invalid";
else if ( $first_name == null )
$errormessage = "Please provide your first name";
else if ( $last_name == null )
$errormessage = "Please provide your last name";
else if ( $address == null )
$errormessage = "Please provide your street address";
else if ( $city == null )
$errormessage = "Please provide your city";
else if ( $state == null )
$errormessage = "Please provide your state or province";
else if ( $postal_code == null )
$errormessage = "Please provide your postal code";
else if (( $lists_1 == null ) and ( $lists_2 == null ) and ( $lists_3 == null ))
$errormessage = "Please select at least one e-mail list to subscribe to";
else if (( $referrer == "1" ) and ( $referrer_website == null ))
$errormessage = "You selected \"Web site\" for how you heard about us. Please fill in the box under that choice to indicate which Web site.";
else if (( $referrer != "1" ) and ( $referrer_website != null ))
$errormessage = "Please select \"Web site\" if you wish to write in wich Web site referred you to Nurture Your Nature. Otherwise, please remove the text from this field.";
else if (( $referrer == "6" ) and ( $referrer_other == null ))
$errormessage = "You selected \"Other\" for how you heard about us. Please fill in the box under that choice to provide more detail.";
else if (( $referrer != "6" ) and ( $referrer_other != null ))
$errormessage = "Please select \"Other\" if you wish to submit your write-in answer for how you heard about us. Otherwise, please remove the text from the \"Other\" field.";
if ( $errormessage == null )
{
if (( $set_email_from_as_contact_email ) and ( $email != null ) and ( isValidEmail( $email )))
{
$from = cleanName( $name ) . " <$email>";
$from_address = $email;
}
else
{
$from = $default_from_name . " <$default_from_address>";
$from_address = $default_from_address;
}
$body = "";
$body .= "IMPORTANT NOTE: This e-mail is the only action that has been taken in the subscription process. In order for this person to actually receive these e-mails, they must be manually appended to the lists for which they have subscribed\n\n";
$body .= "Subscription(s):";
if ( ( $lists_1 == 1 ))
$body .= "\n\n \"News Alerts: Female Sexuality in the News\"";
else
$body .= "";
if ( ( $lists_2 == 2 ))
$body .= "\n\n \"News from the National Women's Health Resource Center (NWHRC)\"";
else
$body .= "";
if ( ( $lists_3 == .3 ))
$body .= "\n\n \"News from the Association of Reproductive Health Professionals (ARHP)\"";
else
$body .= "";
$body .= "\n\n E-mail: " . $email;
$body .= "\n First Name: " . $first_name;
$body .= "\n Last Name: " . $last_name;
if ( $degree == null )
$body .= "\n Degree: *not provided";
else
$body .= "\n Degree: " . $degree;
if ( $affiliation == null )
$body .= "\n Affiliation: *not provided";
else
$body .= "\n Affiliation: " . $affiliation;
$body .= "\n\n Address: " . $address;
$body .= "\n $city, $state $postal_code";
$body .= "\n $country";
if ( $country == null )
$body .= "\n *country not provided";
if ( $referrer == null )
$body .= "\n\nHeard about us: *not provided";
else if ( $referrer == "1" )
$body .= "\n\n Heard about us: Web Site ($referrer_website)";
else if ( $referrer == "2" )
$body .= "\n\n Heard about us: ARHP publication";
else if ( $referrer == "3" )
$body .= "\n\n Heard about us: NWHRC publication";
else if ( $referrer == "4" )
$body .= "\n\n Heard about us: Colleague";
else if ( $referrer == "5" )
$body .= "\n\n Heard about us: Conference/Continuing Medical Education Event";
else
$body .= "\n\n Heard about us: " . $referrer_other;
$body .= "\n\n\nThis information was submitted from:";
$body .= "\nhttp://www.nurtureyournature.org/prof_email_alerts.php";
$body .= "\n\nSubmitted from a computer with IP address: " . $REMOTE_ADDR;
$body .= "\n\n";
$mail = new mime_mail;
$mail->from = $from;
$mail->to = $to;
$mail->headers = "Reply-to: $from_address";
$mail->subject = $subject;
$mail->body = $body;
$data = $mail->get_mail();
$smtp = new smtp_mail;
if ( $smtp->send_email( $smtp_server, $from_address, $to, $data ) == true )
$this_page = 2;
else
$errormessage = "Sorry, we encountered an error while trying to submit your subscription information. This may be due to some technical issues on our end, a connection problem on your end, or someone else's problem in between. Please try again later.";
}
}
?>
|
|
|
|
 |
| |
| |
Professional Edition E-mail Updates |
| |
if (( $errormessage != null ) or ( $this_page == 1 )) { ?>
} else { ?>
| |
|
Subscription Confirmed!
The e-mail address echoHTML( $email ) ?> has been signed up to receive the following Professional Edition E-mail Updates offerings:
if ( ( $lists_1 == 1 )) { ?>
"News Alerts: Female Sexuality in the News"
} else { ?>
} ?>
if ( ( $lists_2 == 2 )) { ?>
"News from the National Women's Health Resource Center (NWHRC)"
} else { ?>
} ?>
if ( ( $lists_3 == 3 )) { ?>
"News from the Association of Reproductive Health Professionals (ARHP)"
} else { ?>
} ?>
This is a free service of Nurtureyournature.org.
If you believe that there has been a mistake, please contact us.
You may unsubscribe at any time.
|
 |
} ?>
|
|
| |
|
 |
|
|
 |
|