Is there a way to customise our MachForms so that a submission automatically BBCs a particular email address- same one every time?
Thanks!
Is there a way to customise our MachForms so that a submission automatically BBCs a particular email address- same one every time?
Thanks!
Yes, you might wan to check this post:
http://www.appnitro.com/forums/topic/to-and-bcc-email-addresses?replies=4
Only problem is that some forms go to multiple email addresses but we'll have only one BCC. Is there was a way so that the first email address was the BCC and then any others after that would be recipients? So would switching it around to this work...
$i = 1;
$has_email = false;
foreach ($email_address as $email){
$email = trim($email);
if(!empty($email)){
if ($i == 1)
$mail->AddBCC($email);
else
$mail->AddAddress($email);
$has_email = true;
$i++;
}
}
Yes, replace to these code would possible to send the first email as BCC and another as the receipient
$i = 1;
$has_email = false;
foreach ($email_address as $email){
$email = trim($email);
if(!empty($email)){
if ($i == 1)
$mail->AddBCC($email);
else
$mail->AddAddress($email);
$has_email = true;
$i++;
}
}
Do you found any problem with the changes ?
So then I need to add this too?
if($has_email){
$send_status = $mail->Send();
$mail->ClearBCCs();
$mail->ClearAddresses();
That block of code already exist, except for this line:
$mail->ClearBCCs();
so you only need to insert that one.
Here is what I have from line 468 to 491:
$i = 1;
$has_email = false;
foreach ($email_address as $email){
$email = trim($email);
if(!empty($email)){
if ($i == 1)
$mail->AddBCC($email);
else
$mail->AddAddress($email);
$has_email = true;
$i++;
}
}
if($has_email){
$send_status = $mail->Send();
$mail->ClearBCCs();
$mail->ClearAddresses();
if($send_status !== true){
echo "Error sending email: ".$mail->ErrorInfo;
}
}
}
I tried it out by entering three email addresses in the "Send notifications emails to" field. The first one was to be the BCC and then the other two were just normal email addresses. When I submitted the form, email address two and three got the form submission via email but not the first one (the BCC). Any ideas what am I missing that it is preventing the first email (BCC) from coming through?
Hmm.. the code seems fine. Is it possible to send me your "helper-functions.php" file, so I can test it directly. You can send the file to here :
customer.service[at]appnitro.com
You must log in to post.