Jump to content

Set BCC if


lukeawade

Recommended Posts

Ok so now I'm having this problem. I am using a trigger to send the email. I still need to send the email to the person who registers but I only need to recieve an email if they need a cd. I tried putting the code you gave me to set the bcc to me if they choose CD but its not working.

<? php

//start Trigger_SendEmail trigger

//remove this line if you want to edit the code by hand

function Trigger_SendEmail(&$tNG) {

 $emailObj = new tNG_Email($tNG);

 $emailObj->setFrom("[email protected]");

 $emailObj->setTo("{email}");

 $emailObj->setCC("");

if ($_POST['distribution_method'] != "CD") { $emailObj->setBCC("[email protected]"); }

 $emailObj->setSubject("Children's Mercy Hospital ED OR :: MySmartPlans Project Registration");

 //WriteContent method

  $emailObj->setContent("{first_name},

 

 Thank you for registering If you chose to download the software installer, or if you would now like to download the installer before you receive your install CD, please follow the directions below.

 

Thank you,

 

 The Project Information Management Team

 

(Preferred Delivery Method: {distribution_method})

 ");

 $emailObj->setEncoding("ISO-8859-1");

 $emailObj->setFormat("HTML/Text");

 $emailObj->setImportance("Normal");

 return $emailObj->Execute();

}

//end Trigger_SendEmail trigger

?>

 

Link to comment
https://forums.phpfreaks.com/topic/118661-set-bcc-if/
Share on other sites

Check your code - something is wrong what you are saying.

 

Here you say:

"I tried putting the code you gave me to set the bcc to me if they choose CD but its not working."

 

But in the code you are doing diferrently:

 

if ($_POST['distribution_method'] != "CD")

 

Here you are setting if CD IS NOT chosen then send to BCC.

 

You need to do this:

if ($_POST['distribution_method'] == "CD")

Link to comment
https://forums.phpfreaks.com/topic/118661-set-bcc-if/#findComment-610923
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.