Support

Home Forums Event Espresso Premium Email template conditional tags support

Email template conditional tags support

Posted: May 3, 2016 at 1:29 am


additout

May 3, 2016 at 1:29 am

Hi,

I’m trying to make custom templates for emails using the mailchimp template designer, exporting the template, paste inside the template editor and replace with shortcodes. Looks promising to avoid the Outlook email design problems and so, but the conditional tags are detected like invalid shortcodes.

An error has occurred:
The following shortcodes were found in the "[EVENT_LIST]" field that ARE not valid: [if gte mso 9],[endif],[if mso],[endif],[if mso],[endif],[if mso],[endif],[if mso],[endif],[if gte mso 9],[endif],[if gte mso 9],[endif],[if gte mso 9],[endif],[if gte mso 9],[endif]
Valid shortcodes for this field are:... 

The conditional tags I’m trying looks like this


                            <!--[if gte mso 9]>
                            </td>
                            <td align="center" valign="top" width="300" style="width:300px;">
                            <![endif]-->

Is there any way to escape those conditional tags or similar to try to apply those fixes for Outlook?


Tony

  • Support Staff

May 3, 2016 at 4:31 am

Hi there,

Currently you can not escape the shortcodes within the messages system so to allow for those shortcodes your going to need to ‘register’ them as valid shortcodes within the messages system, then return the shortcode itself when the shortcode is parsed.

So if you have [if gte mso 9] as a valid shortcode within various sections of the message you would just return ‘[if gte mso 9]’ when that shortcode is parsed.

Here is an example of how you can do that:

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

Note you will likely need to add additional ‘valid’ shortcodes to that list and depending on the sections you want to use those tags you will likely need additional checks within the instanceof conditionals for the shortcode types.

You can add the above function to your child themes functions.php file or a Site Specific Plugin. Be sure to check ALL of your message functionality continues to work as the above is not something we officially support.

The support post ‘Email template conditional tags support’ 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