Support

Home Forums Event Espresso Premium Multiple (Three) Registration Confirmation Emails to Subscriber and Admin

Multiple (Three) Registration Confirmation Emails to Subscriber and Admin

Posted: July 16, 2013 at 8:29 am


Pranu Bhargava

July 16, 2013 at 8:29 am

Folks:

This is our environment
Event Espresso version 3.1.33.3.P
WordPress version WP 3.5.2

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,
Pranu

  • This topic was modified 10 years, 9 months ago by  Pranu Bhargava.
  • This topic was modified 10 years, 9 months ago by  Pranu Bhargava. Reason: remove links to site


David Neudorfer

July 16, 2013 at 11:43 am

I’m interested in the same thing.


Josh

  • Support Staff

July 16, 2013 at 2:11 pm

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.


Pranu Bhargava

July 16, 2013 at 2:42 pm

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
$fields['fee_payer'] = 'payee';

I tried testing without that line – and we have the same issue.

ANy other thoughts?


Josh

  • Support Staff

July 16, 2013 at 2:58 pm

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.


Pranu Bhargava

July 16, 2013 at 3:23 pm

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
and then the next line is
/thanks-registration

The thanks-registration is a permalink for the page_id=xx referenced above.

Could this be a double hit causing duplicate emails?


Josh

  • Support Staff

July 16, 2013 at 3:47 pm

There’s one way to find out: You can try temporarily setting WP to use the default permalink.


Pranu Bhargava

July 17, 2013 at 7:13 am

Josh:

I attempted the following
a. Switch to TwentyEleven theme
b. Turn off all plugins except non Even Espresso Plugins and wpMandrill.
c. Switch Permalinks to default

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.


Josh

  • Support Staff

July 17, 2013 at 7:24 am

Do you get fewer emails if wpmandrill is deactivated?


Pranu Bhargava

July 17, 2013 at 7:33 am

Just tried it – 3 emails.

2 emails at 9:26:01 Eastern
1 email at 9:30:08 Eastern


Pranu Bhargava

July 17, 2013 at 7:36 am

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.


Pranu Bhargava

July 17, 2013 at 8:15 am

Josh:

I setup a new wordpress instance. Did the following tests…

TwentyTwelve, Default permalinks, Only Event Espresso plugin active – Only 1 email sent
New Theme, Default permalinks, Only Event Espresso plugin active – Only 1 email sent
New Theme, “Post Name” permalinks, Only Event Espresso plugin active – TWO emails sent
Created new thanks page after the step above and switched Event Espresso to use the new Thanks page – TWO emails 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.


Pranu Bhargava

July 17, 2013 at 8:31 am

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?


Josh

  • Support Staff

July 17, 2013 at 9:38 am

Are you on WP Engine by chance?


Pranu Bhargava

July 17, 2013 at 9:42 am

No we are not. This is our own server.


Josh

  • Support Staff

July 17, 2013 at 10:09 am

Is this an apache server?


Pranu Bhargava

July 17, 2013 at 10:24 am

Yes – Apache – running multiple wordpress sites.


Josh

  • Support Staff

July 17, 2013 at 11:13 am

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.


Pranu Bhargava

July 17, 2013 at 11:15 am

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


Josh

  • Support Staff

July 17, 2013 at 4:08 pm

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';


Pranu Bhargava

July 17, 2013 at 4:27 pm

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.


Pranu Bhargava

July 17, 2013 at 4:34 pm

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.


karen bowness

July 18, 2013 at 12:41 am

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


Josh

  • Support Staff

July 18, 2013 at 9:15 am

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');


Josh

  • Support Staff

July 18, 2013 at 9:16 am

@ Pranu,

You could try changing the &id= to ?id= in the above snippets.


Pranu Bhargava

July 18, 2013 at 9:24 am

@josh – yeah already had made that change.

Any thoughts on the later post back from WePay?


Josh

  • Support Staff

July 19, 2013 at 10:09 am

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?


karen bowness

July 31, 2013 at 6:25 pm

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…


Sidney Harrell

July 31, 2013 at 9:00 pm

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.


Pranu Bhargava

August 1, 2013 at 7:32 am

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.


Josh

  • Support Staff

August 1, 2013 at 8:16 am

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.

Event Espresso