Support

Home Forums Event Espresso Premium ANSWER and QUESTION LIST shortcode don't works

ANSWER and QUESTION LIST shortcode don't works

Posted: December 18, 2019 at 4:08 am

Viewing 8 reply threads


ABoccaccio

December 18, 2019 at 4:08 am

I am trying to get the answers to personalized questions in a notification of “unapproved registration” but, despite the correct placement of the shortcodes (I tried both ANSWER_ * and QUESTION_LIST and also the “PRIMARY_REGISTRANT” versions. No error is displayed, simply nothing appears in the mail (the fields have been correctly filled in by the users). The texts of my questions contain slashes “/”, could it cause problems?


Tony

  • Support Staff

December 18, 2019 at 4:51 am

Hi there,

Do you want to list all of the custom questions from the registration(s), or specific questions/answers?

[QUESTION_LIST] would be used to list every question.

[RECIPIENT_ANSWER_*{question-text}] would be used for specific answers.

I’ll provide details on how to set either up if you let me know what you are trying to do.

The texts of my questions contain slashes “/”, could it cause problems?

It should not cause any issues.


ABoccaccio

December 18, 2019 at 5:08 am

I am interested in a specific question (to show the company of the person registering), but it would also be good to visualize them all. I have to add it in the notification to the administrator, not the one that is sent to the user. I’ve tried both shortcodes, but none works as it should. I’m pretty sure I entered the shortcodes correctly, I also read several previous posts on this forum.


Tony

  • Support Staff

December 18, 2019 at 5:11 am

Where are you adding the shortcodes in that template?

What section?


Tony

  • Support Staff

December 18, 2019 at 5:31 am

Actually, I can just show you both.

So in Event Espresso -> Messages -> Default message tyemplates -> Not Approved Registration

You have 2 ‘blue’ links right? One shows ‘Edit Event Admin’ and the other ‘Edit Primary Registrant’

The important point is they are not grey. If either/both of them are, that context is disabled by either the toggle at the top of the editor when edit it, or the ‘To’ field is set to nothing.

So, in the Event Admin context, go to the [ATTENDEE_LIST] section.

There you want to add something like:

<li>
    <strong>Single Answer</strong></br>
    Test 29: [ANSWER_*Test 29]
</li>

[ANSWER_*Test 29] on my site calls the answer to a question with the question text set to ‘Test 29’, your shortcode will be different (as will the ‘leading text’ before it.

Add that before the closing </ul> and <hr/> tag, like so – https://monosnap.com/file/gG1mr8LnAF1MypMSDIolXu5jN3Cs6g

The ANSWER_* shortcodes need the question text passed after the * and it must match exactly. That’s outputting the answer to a specific question and will work for all registrations in the group, not just the primary (that’s why I used ATTENDEE_LIST).

—–

If you want to output all questions/answers it’s a similar setup, but you use [QUESTION_LIST], there is a difference but I’ll explain in a second so in place of the above you would need:

<li>
    <strong>Questions</strong>
    <ul>[QUESTION_LIST]</ul>
</li>

The _LIST shortcodes basically call the sections in the template and loop over that section for each element it relates to. So in this case [QUESTION_LIST] uses the QUESTION_LIST section at the bottom of the page and whatever you set there it does for each question linked to the current recipient/attendee.

By default that will be empty so add something like this:

<li>[QUESTION] : [ANSWER]</li>

You can add additional html tags if preferred, but that section now goes over every question and outputs {question text} : {answer} in a UL (hence the ul around the shortcode in attendee list and the li’s in this section.

Save the template and retrigger a registration message, you’ll see something like this: https://monosnap.com/file/boEiQUmxHFXXFvh07GVr4X67Jm7OBe


ABoccaccio

December 18, 2019 at 5:53 am

I use the personalized message and not the default one, but yes, the link is blue. Other customizations of the message are already active, the mail arrives configured with text the logos as I would like them. Even the code part includes the textual changes I have inserted, but the shortocode does not work. For example, if I write: “ Answers:
[QUESTION_LIST] “I see the word” Answers “but nothing else.

I confirm that the code I added in the ATTENDE_LIST section.


Tony

  • Support Staff

December 18, 2019 at 6:00 am

Answers:
[QUESTION_LIST] “I see the word” Answers “but nothing else.

What do you have in the QUESTION_LIST section?


ABoccaccio

December 18, 2019 at 6:21 am

Thanks to your suggestions I have solved.
The question list field was not correctly filled out. Previously I was not able to make the shortcode answer * work but it doesn’t matter, now it works the way I wanted it to be 🙂


Tony

  • Support Staff

December 18, 2019 at 6:35 am

Great.

Just to note for any future readers, there are only 2 valid shortcodes for the QUESTION_LIST section.

[QUESTION] & [ANSWER]

If you click on the icon next to each individual section you can see the shortcodes valid for that section.

You can obviously use additional HTML markup in those sections but the message system has its own valid shortcodes and each section has specific shortcodes that are valid.

Viewing 8 reply threads

The support post ‘ANSWER and QUESTION LIST shortcode don't works’ 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