Messages System: Shortcodes
Message shortcodes are special snippets of text that allow for precisely controlling how dynamic content will display in the message template. If you are familiar with how WordPress shortcodes work then using these shortcodes should be fairly straightforward. Shortcodes such as [EVENT_NAME]
, [REGISTRANT_FNAME]
, [EVENT_AUTHOR_FORMATTED_EMAIL]
all provide an easy way to indicate where dynamic content will be inserted when messages are sent.
There are also special shortcodes that we call list-type shortcodes. These are shortcodes such as [ATTENDEE_LIST]
, [EVENT_LIST]
, and [QUESTION_LIST]
[1]. These shortcodes are special because when you use it, you are indicating that this is where you want a list of items to be displayed in your template. When the message generator[2] gets to this shortcode, it will signal it to look for a corresponding field in the template to know how to parse each item in the list. So when you see a field in a message template that is labelled with [event_list]
then you know that when the [EVENT_LIST]
shortcode is parsed, the generator will look in the
[event_list]
field to know how to parse each event item.
Display Answers to Questions in Your Templates
To display all answers:
You add the
[QUESTION_LIST]
shortcode to the [ATTENDEE_LIST]
section, then within the
[QUESTION_LIST]
section you can add the [QUESTION]
and [ANSWER]
shortcodes.
To display individual answers:
Add the
[RECIPIENT_ANSWER_*]
shortcode in a valid location, and use the question display text you are testing. In my case the question was “What color?” so when I added the shortcode it was
[RECIPIENT_ANSWER_* What color?]
I also prefaced the shortcode with the actual question text so I could tell that I was seeing the right message when I received it.
Note: It is VERY important that your question display text match exactly what the question is.