Conditional keyword replacement in email body

(Mitch Kerry) #1


We want to be able to display different responses based on the value of one of the responses in the body of an email.

Something similar to this:
%response_XXXX_q1^eq:test:%response_XXXX_q2%:%response_XXXX_q3%% (this breaks)

%response_XXXX_q1^eq:test:{%response_XXXX_q2%}:{%response_XXXX_q3%}% (this breaks)

Is this possible in our version?

Appreciate the help

(Hugh McMaster) #2

Custom form responses are typically values in an array or a JSON object, depending on what type of form field you’re using.

Have you checked the output of %response_XXXX_q1% or checked %globals_post%?

(Mitch Kerry) #3


Yes I can get the values, but when I put the keyword replacements in the conditional it breaks.

I have tried:

The response is: %response_123783_q1%
Is the response test? %response_123783_q1^eq:test:yes %response_123783_q1%:no %response_123783_q1%%
Is the response test? %response_123783_q1^eq:test:yes %globals_response_123783_q1%:no %globals_response_123783_q1%%
Is the response test? %response_123783_q1^eq:test:yes {%globals_response_123783_q1%}:no {%globals_response_123783_q1%}%
Is the response test? %response_123783_q1^eq:test:yes%globals_post_q123783:q1%:no%
Is the response test? %response_123783_q1^eq:test:yes{%globals_post_q123783:q1%}:no%


This is the email:
The response is: test

Is the response test? %response_123783_q1^eq:test:yes test:no test%

Is the response test? yes globals_response_123783_q1%:no %

Is the response test? yes {globals_response_123783_q1%}:no {}%

Is the response test? yesglobals_post_q123783:q1%:no%

Is the response test? yes{globals_post_q123783:q1%}:no%



What I would expect is:
Is the response test? yes test
Is the response test? no


(Hugh McMaster) #4

Okay. What happens if you try these keywords:


(Mitch Kerry) #5

So we’ve worked it out.

We applied a paint layout to the submission email body:

And then in the paint layout we can use the conditional:
Question is equal to test. Here is the field
It is not test

Hope that helps.


(Hugh McMaster) #6

This won’t work as you intend. It’s not a valid keyword sequence.

The ‘else’ line should be %else_question%.

Also, does your paint layout apply correctly for emails sent to public users?

(Mitch Kerry) #7

Thanks Hugh

Actually no…it doesn’t work for public users we’ve since found out.
Yet to get to the bottom of that.

(Hugh McMaster) #8

Okay, if you find out, I’d be interested in the solution. Otherwise, I’d suggest following the solution here: Paint layout in custom form emails