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' );
$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' );
$lists_4 = cleanPostVariable( 'lists_4' );
$lists_5 = cleanPostVariable( 'lists_5' );
$lists_6 = cleanPostVariable( 'lists_6' );
$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 = "Consumer E-mail Signup";
$set_email_from_as_contact_email = false;
$require_email_address = true;
// ******************************************************************
// the following 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 == true ) 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 ) and ( $lists_4 == null ) and ( $lists_5 == null ) and ( $lists_6 == null ))
$errormessage = "Please select at least one e-mail list to subscribe to";
else if (( $referrer == "web_site" ) 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 != "web_site" ) 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 == "other" ) 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 != "other" ) 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";
else
{
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 \"National Women's Health Report Online (HTML)\"";
else
$body .= "";
if ( $lists_4 == 4 )
$body .= "\n\n \"Healthy Women Take 10\"";
else
$body .= "";
if ( $lists_5 == 5 )
$body .= "\n\n \"National Women's Health Report Online (Text only)\"";
else
$body .= "";
if ( $lists_6 == 6 )
$body .= "\n\n \"NWHRC Health Exclusives / Specialty Publications\"";
else
$body .= "";
$body .= "\n\n E-mail: " . $email;
if ( $first_name == null )
$body .= "\n First Name: *not provided";
else
$body .= "\n First Name: " . $first_name;
if ( $last_name == null )
$body .= "\n Last Name: *not provided";
else
$body .= "\n Last Name: " . $last_name;
if ( $address == null )
$body .= "\n\n Address: *not provided";
else
$body .= "\n\n Address: " . $address;
if (( $city == null ) and ( $state == null ) and ( $postal_code == null ))
$body .= "\n *city, state and postal code not provided";
else
$body .= "\n $city, $state $postal_code";
if ( $country == null )
$body .= "\n *country not provided";
else
$body .= "\n $country";
if ( $referrer == null )
$body .= "\n\n Heard about us: *not provided";
else if (( $referrer == "web_site" ))
$body .= "\n\n Heard about us: Web Site ($referrer_website)";
else if (( $referrer == "friend" ))
$body .= "\n\n Heard about us: Through a Friend";
else if (( $referrer == "hc_provider" ))
$body .= "\n\n Heard about us: Through my health care provider";
else if (( $referrer == "arhp_pub" ))
$body .= "\n\n Heard about us: ARHP publication";
else if (( $referrer == "nwhrc_pub" ))
$body .= "\n\n Heard about us: NWHRC publication";
else
$body .= "\n\n Heard about us: " . $referrer_other;
$body .= "\n\n\nThis information was submitted from:";
$body .= "\nhttp://www.nurtureyournature.org/con_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.";
}
}
?>
|
|
|
|
 |
| |
| |
Consumer E-mail News 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 Consumer E-mail News 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 )) { ?>
"National Women's Health Report Online (HTML)"
} else { ?>
} ?>
if ( ( $lists_4 == 4 )) { ?>
"Healthy Women Take 10"
} else { ?>
} ?>
if ( ( $lists_5 == 5 )) { ?>
"National Women's Health Report Online (Text only)"
} else { ?>
} ?>
if ( ( $lists_6 == 6 )) { ?>
"NWHRC Health Exclusives / Specialty Publications"
} 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.
|
 |
} ?>
|
|
| |
|
 |
|
|
 |
|