Support

Home Forums Event Espresso Premium Can I use shortcodes from other message types?

Can I use shortcodes from other message types?

Posted: June 2, 2017 at 1:03 am


ATi

June 2, 2017 at 1:03 am

Hi there,

Can I use shortcodes from HTML message types in Email message types? For example, I’d like to use the [PAYMENT_GATEWAY_TXN_ID] shortcode from the Invoice message type in the Event Admin and Primary Registrant message types.

Thanks!


Tony

  • Support Staff

June 2, 2017 at 4:33 am

Hi there,

The short answer is no, not for that shortcode at least, however, you can add your own shortcode to do it.

You don’t mention the message type you’re wanting to use the above shortcode in, only the contexts but I’m assuming you are referring to any of the registration based messages (for example the Registration Approved messages type).

Its not really about bringing HTML message type shortcodes to other templates as it doesn’t work that way (although it may seem it), the Receipt and Invoice messages have access to all of the ‘Payment’ related shortcodes because they have access to all of the payment objects for a transaction (because they are specifically designed to pull those details in).

The registration message templates are based on the registrations, not payments, they have access to the registrations and their transactions, so only show the shortcodes for the objects they have available.

[PAYMENT_GATEWAY_TXN_ID] is a payment specific shortcode, you can have multiple payments within a transaction so to use that shortcode you’d need another section within the message template that looped over every payment in the transaction (even if theres just one) and output the gateway transaction ID for each specific payment. That’s not intended for the registration messages and is not something we are currently looking to add as it will clutter the template for little additional value.

However, as mentioned above registration messages have access to the Transaction, the transaction has access to its payments. So you could create a new shortcode, for example [LAST_PAYMENT_GATEWAY_TXN_ID] which pulled the last payment object in from the transaction and then you used that to output the gateway transaction id in the same way the other shortcode does if you are comfotable with PHP.

(Note: We do not provide support for custom development, we can point you in the right direction but if you are not confident in adding your own shortcode I recommend contact a developer familiar with Event Espresso to add it for you)

The support post ‘Can I use shortcodes from other message types?’ 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