Posted: July 16, 2013 at 8:29 am
|
Folks: This is our environment We are running the wpMandrill plugin and sending mail from Mandrill. Here is a test case – https://dl.dropboxusercontent.com/u/9626652/multiemail.png – I am registering pranu2@bhargava.com for an event. The admin of the site is pbhargava@allcampus.com You will notice that 3 emails are fired to the person who is registering, 3 emails are triggered to the admin of the site and 2 payment gateway variable dumps are fired. I looked up the forum and tried various suggested solutions – using fancy email headers, a browser/cookie issue, etc – but really not sure how or why this is happening. Any suggestions? You can attempt to register here (link removed – I can PM it) (the site is currently in testing with an integration to staging environment of the payment gateway) Thanks,
|
|
I’m interested in the same thing. |
Hi there, There may be an issue with communication between your website and the Payment processor. If the Payment processor does not get a receipt of the Instant Payment notification, it may be sending out multiples of the same payment notification, which will trigger additional emails if the emails are set to go out when the payment is made. The pages that handle the IPN listener, which can be either the “Transactions” page or the “Thank You” page depending on the gateway should be checked to make sure they are publicly viewable on the internet, and not being forced to load as https if there isn’t an SSL certificate installed. |
|
|
Hey Josh. So I think you have your finger on the right problem – because I just got some emails – way after the test transaction. We do require emails only AFTER the payment. But the issue is that both my transactions page and thank you page are publicly viewable and SSL is fine on the domain – in fact we require it. Now all this is of course on the “testing” site of the payment gateway. We are using WePay. I have also modifief wepay_vars.php to include the line I tried testing without that line – and we have the same issue. ANy other thoughts? |
You can try disabling other plugins and even temporarily switching to the default WP theme. It could be a number of things that’s causing this to happen and it’s a quick way to rule something out. |
|
|
Josh: I attempted that with the default theme and still seems to happen. Once interesting thing in my ssl access log that I notice is that the payment gateway seems to send the traffic back to /?page_id=xx The thanks-registration is a permalink for the page_id=xx referenced above. Could this be a double hit causing duplicate emails? |
There’s one way to find out: You can try temporarily setting WP to use the default permalink. |
|
|
Josh: I attempted the following I still get 3 emails to the registering prospect, 3 emails to the admin about the registration, 2 gateway variable dump emails. Now the funny thing is that 2 emails come together at the same time, and then 1 comes through later as an afterthought – with a later timestamp. |
Do you get fewer emails if wpmandrill is deactivated? |
|
|
Just tried it – 3 emails. 2 emails at 9:26:01 Eastern |
|
I have the logs from espresso_log.txt if you like. I did put in a statement to write to the log just before it sends the email so I can see when the email fire action is being called. I do see 3 distinct calls to it. So for some reason the system is loading email.php thrice. |
|
Josh: I setup a new wordpress instance. Did the following tests… TwentyTwelve, Default permalinks, Only Event Espresso plugin active – Only 1 email sent Any ideas on why permalinks might be causing a double email – any other setting I can change? Would be nice to have better URLs than the default. I got just one email. |
|
And some more info…. So for the permalinks to work – this is from the httpd access log 10.4.9.140 – – [17/Jul/2013:10:27:45 -0400] “GET /?page_id=375&id=10&r_id=1-51e6a9c3a2150&event_id=1&attendee_action=post_payment&form_action=payment&type=wepay&checkout_id=1503846178 HTTP/1.1” 301 – “-” “Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.71 Safari/537.36” 534385 10.4.9.140 – – [17/Jul/2013:10:27:46 -0400] “GET /pranu-thanks/?id=10&r_id=1-51e6a9c3a2150&event_id=1&attendee_action=post_payment&form_action=payment&type=wepay&checkout_id=1503846178 HTTP/1.1” 200 14896 “-” “Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.71 Safari/537.36” 1230821 So clearly the first URL is getting a 301 – so that wouldn’t run anything on the server and then the second URL is hit which would then run the appropriate code – but I wonder why that causes 2 emails to be triggered? |
Are you on WP Engine by chance? |
|
|
No we are not. This is our own server. |
Is this an apache server? |
|
|
Yes – Apache – running multiple wordpress sites. |
If it’s multisite, then it could be the way that the .htaccess rules are set up. Event Espresso isn’t technically developed for multisite (although many folks out there are using it). When you set up the .htaccess rules do these include the WP multisite rewrite rules? One thing that may help is changing the gateway files to point to the “pretty_URL” instead of the default URL. In most cases the default URL will work even if the custom postname URL/pretty permalink option is set, but there may be something unique to your server’s set up that’s causing this to happen. |
|
|
Josh – sorry I made it a bit confusing. We are NOT using the multisite feature of wordpress. Each wordpress install is its own silo. So this instance is standalone using its own set of plugins, etc. Sorry about the confusion. Pranu |
I think the idea of changing the gateway files could apply either way. For Wepay, this is in /gateways/wepay/wepay_vars.php on line 28 and 29. You could try changing them to something like this: $fields['redirect_uri'] = get_permalink($org_options['return_url']) . '&id=' . $attendee_id . '&r_id=' . $registration_id . '&event_id=' . $event_id . '&attendee_action=post_payment&form_action=payment&type=wepay'; $fields['callback_uri'] = get_permalink($org_options['notify_url']) . '&id=' . $attendee_id . '&r_id=' . $registration_id . '&event_id=' . $event_id . '&attendee_action=post_payment&form_action=payment&type=wepay'; |
|
|
Ok Josh! That was awesome. That got rid of the duplicate email thing – where 2 were coming at the same time. So Now those 2 have gone to 1. But I still have a straggler email – that comes about 3-5 minutes later. This used to be my 3rd email but now its the second. Going to dig the logs to see if we can pinpoint what is causing this one. |
|
Ok I think the trigger for this straggler email was a post to the transactions page from the “WePay API Callback Agent” POST /transactions/?id=XXX&r_id=X-XXXXXXXX&event_id=XXX&attendee_action=post_payment&form_action=payment&type=wepay Wonder why there is a second post back. |
|
If I could jump in on this topic – we are also experiencing troubles with exactly 3 payment confirmation emails sent to clients since integrating with Merchant Warrior. Obviously it’s not ideal with clients calling to ask if they have paid 3 times, but with a busy site it’s hard to test. I’ve made sure the pages are public, and just unticked the fancy headers (hopeful) – but this doesn’t seem to be a one off problem… Will the half solution above work for Merchant Warrior? Currently using 3.1.32.2.P and WordPress 3.5.1 – http://www.becsouthernsydney.com.au |
Hi Karen, The fancy headers option shouldn’t affect this. There may be a different cause with the issue you’re seeing because it’s a different gateway (Merchant Warrior) and your server setup is likely different. What you can try is go into /gateways/mwarrior/mwarrior_vars.php when the site isn’t in a busy period (or set up a subdomain for testing on the same server) and change lines 49 and 51 to be as follows: line 49: $mwarrior->addField('returnURL', get_permalink($org_options['return_url']) . '?id=' . $attendee_id . '&r_id=' . $registration_id . '&event_id=' . $event_id . '&attendee_action=post_payment&form_action=payment&type=mwarrior'); and 51: $mwarrior->addField('notifyURL', get_permalink($org_options['return_url']) . '?id=' . $attendee_id . '&r_id=' . $registration_id . '&event_id=' . $event_id . '&attendee_action=post_payment&form_action=payment&type=mwarrior'); |
|
@ Pranu, You could try changing the |
|
|
@josh – yeah already had made that change. Any thoughts on the later post back from WePay? |
Hi Pranu, It might be worth checking to see if this is related to something with the redirect to https. Can you temporarily disable the https redirect for the front-end registration pages? |
|
|
Hi, thanks Josh, that seemed to have taken the emails down to 2, similar to Pranu. Are there any other obvious changes I can make to help get rid of the other? I understand I may have to wait for you two to confirm a fix as it seems like the same problem, but I don’t believe I’m as technically minded… |
|
If the user getting sent back to the thank-you page is triggering one email and the notification to the transactions page is triggering another, duplicate email, you can try disabling the trigger on one or the other. Which is up to you, and might depend on the gateway. If users are sometimes not going back to the thank you page (like paypal), disabling the one on the transactions page might result in them getting no email. But some gateways might not send notifications (like authorize.net SIM) and only use the thank-you page. The one for the transactions page is in gateways/process_payments.php line 199: do_action('action_hook_espresso_email_after_payment', $payment_data); Just comment it out by placing two slashes in front: // do_action('action_hook_espresso_email_after_payment', $payment_data); The one for the thank-you page is in includes/process-registration/payment_page.php line 407 and is the same code. |
|
Karen: We were unable to figure out what was causing the extra emails ourselves. But since we had to launch, I decided to do email before payment, rather than post payment. But I believe Sidney’s suggestion might actually work out well. Based on the research I did, we were getting an extra email sent out after the effect when our payment gateway was hitting the transaction page at a later time – not sure why. So this was causing a delayed second email. Now if we actually disable the email sending on the transactions page, then that might just take care of things. |
Hi all, There were a few fixes released in Event Espresso 3.1.34.P that makes the transactions page check the payment status before processing and avoid reprocessing payments on the thank you page too. The update also includes a fix for the Wepay, Merchant Warrior, and USAePay gateways to allow for pretty permalinks. So the issues you were seeing in 3.1.33P should all be resolved with these fixes. |
|
The support post ‘Multiple (Three) Registration Confirmation Emails to Subscriber and Admin’ is closed to new replies.
Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.