Support

Home Forums Event Espresso Premium Payment TX ID in Event Admin emails

Payment TX ID in Event Admin emails

Posted: June 9, 2017 at 9:39 am


Patrick

June 9, 2017 at 9:39 am

We need a way to match up Event Admin emails with Paypal emails after someone pays (without going to the website). The only field in common is the payors name, but some of our payors register multiple times. As we cannot edit Paypal emails (to add the EE tx id), we need to add the Paypal ID (payment gateway tx id) to the EE emails.

I looked through the email system, and a code change would be necessary. It seems rather simple, fortunately.
In EE_Payment_Shortcodes.lib.php, see function _init_props() and function _parser(…)
Look for PAYMENT_GATEWAY_TXN_ID in both methods.

Now, look at EE_Transaction_Shortcodes.lib.php
I believe this is the method which builds a list of shortcodes on the edit message templates pages.
Modify functions _init_props() and _parser(…) to include the code noted above.

Any help would be appreciated!
-Patrick


Tony

  • Support Staff

June 9, 2017 at 10:23 am

Hi Patrick,

We don’t provide support for modifying core code so we can’t provide details on how you would change the above within core, however, there are filters in place to add your own shortcodes to the message system.

I recently replied to another member about the very shortcode you are referring to with some details here:

https://eventespresso.com/topic/can-i-use-shortcodes-from-other-message-types/

There is an example of adding your own shortcodes using the available filters here:

https://gist.github.com/Pebblo/e87cc8e30c4848dcdfe2

EE_Transaction_Shortcodes.lib.php is used to build out the ‘EE_Transaction’ shortcodes, which are available to messages that have the transaction object passed to it.

So you’ll want to make sure that $lib is an instanceof EE_Transaction_Shortcodes and add a new shortcode (possible [LAST_PAYMENT_GATEWAY_TXN_ID]) then check that the data you are using is an instance of an EE_Transaction and use that to pull the last payment made, then continue through as you would above.

The support post ‘Payment TX ID in Event Admin emails’ 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