Page 1 of 1

Conditional operator in email template variables

Posted: Wed Apr 27, 2016 12:58 am
by flexappart
A conditional operator within template variables would help to create more versatile/customized emails. Something like [IF:condition:then_text:else_text].
For example: [IF:[REFERRER]="AirBNB":"some payment or cancellation instructions text for AirBNB bookers":"some text for other bookers"].
I am aware that multiple auto-action emails using different triggers could achieve something similar in most cases, but it ends up with many different emails more difficult to maintain.

Re: Conditional operator in email template variables

Posted: Wed Apr 27, 2016 10:43 am
by markkinchin
This is an interesting idea but it would be very difficult to program the IF logic. Perhaps we can come up with some kind of "smart" template variable that shows different text based on a status within the booking

Re: Conditional operator in email template variables

Posted: Wed Apr 27, 2016 11:41 am
by flexappart
Yes it may be good enough to use only a determined status field (instead of any field) for the condition, especially if we can use auto actions to automatically set the content of this determined status field to something that would depend on another attribute of the booking (like the referrer channel in my example).

Re: Conditional operator in email template variables

Posted: Wed May 04, 2016 3:26 pm
by oreste.rivetti
I'm not currently interested in this feature, but I can suggest that a CASE statement with DEFAULT could enhance your proposal.