duplicate/triple emails sent
-
I am using your plugin together with Sendgrid. all good and love it.
Issue we are facing is that SOMETIMES when user submit contact form on website duplicate copies are sent. (doesn’t happen with woocommere emails)
I can see that using a Mail Log Plugin.
The code for sending is this:
wp_mail( $to, $subject . rand(0,1000000), $body, $headers ))I put a rdn number in subject to help trouble shoot. and each sent email has different number. So that code is being run twice. I tried to put Die() is several places but it doesn’t help.
sample of code:
$i=1;
if ($i != 1)
{
die();
}
if(wp_mail( $to, $subject . rand(0,1000000), $body, $headers )){
echo json_encode(array(‘status’=>’success’));
die();
$i++;
} else {
echo json_encode(array(‘status’=>’error’));
}
die();}
It might not be an issue with your plugin but i had to ask, could also be the javascript trigger we have or other things. if you have an idea please suggest.
/J
- The topic ‘duplicate/triple emails sent’ is closed to new replies.