Conditional autoresponder eamil
-
hello everyone,
I’m trying to make contact form 7 send a autorepsonder email with different content based on dropdown selection. I’m using the hook wpcf7_mail_send in functions.php file to generate autoresponder emails depending on visitor’s choice.
I have two questions:
1. how can I force this email to be send as html instead of plain.
2. the email comes in with www-data from name. can I change it to something else?here is the hook I’m using:
// AUTORESPONDER EMAIL – hook in to wpcf7_mail_sent
add_action( ‘wpcf7_mail_sent’, ‘contact_form_autoresponders’ );#our autoresponders function
function contact_form_autoresponders( $contact_form ) {if( $contact_form->id==205276 ){
#retrieve the details of the form/post
$submission = WPCF7_Submission::get_instance();
$posted_data = $submission->get_posted_data();#set autoresponders based on dropdown choice
switch( $posted_data[‘chosen-company’] ){
case ‘[email protected]’:
$msg=”Thank you for contacting ACME Productions. John Smith will contact you shortly.
Email: [email protected]
Telephone: 613.555.5555
Mobile: 613.554.5555″;
break;case ‘[email protected]’:
$msg=”Thank you for contacting Fun Fuctory. Kit Harrington will contact you shortly.
Email: [email protected]
Telephone: 613.555.5555
Mobile: 613.554.5555″;
break;case ‘[email protected]’:
$msg=”Thank you for contacting Ski Shop. Dirk Diggler will contact you shortly.
Email: [email protected]
Telephone: 613.555.5555
Mobile: 613.554.5555″;
break;}
mail( $posted_data[’email’], ‘iNFORMED Partners Program’, $msg );
}
}any help would be greatly appreciated. thank you.
- The topic ‘Conditional autoresponder eamil’ is closed to new replies.