Skip to Content
Menu
This question has been flagged
1 Reply
1815 Views

Hello,

We are migrating from version 14 to version 15 and were wondering how to create SMS templates which use nested if statements in version 15?

Here is an example of version 14 SMS template code we wish to convert to version 15.


% if ctx['delivery_order'].name == 'WH/OUT/00001':
    % if ctx['delivery_order'].state == 'done':
        TEXT A
    % else:
        TEXT B
Avatar
Discard
Best Answer

You can try the below:

{{ (text_A if ctx['delivery_order'].state == 'done' else text_B) if ctx['delivery_order'].name == 'WH/OUT/00001' else ''}}

Avatar
Discard
Related Posts Replies Views Activity
1
Sep 22
2755
1
Dec 22
1516
1
Nov 22
1296
0
Oct 22
1118
0
Apr 23
1846