Conditional Text in emails

  • hide10
  • Topic Author
  • Offline
  • Elite Member
  • Elite Member
More
4 days 8 hours ago #171834 by hide10
Conditional Text in emails was created by hide10
Hello,

I'm trying to use the Conditional Text in emails.
What I want to achieve is:
If ticket is enabled for the event ("ticket_number" field of eb_registrants is NOT "0"), display ticket download link.

I tried something like below:
Code:
{ebShowText [TICKET_NUMBER]~0} <p><a href="[DOWNLOAD_TICKET_LINK]">Download your ticket</a></p> {/ebShowText}

But it does not work. The text is displayed even if ticket_number = 0.

Will you please help me to get it work?

Thank you for your hellp,
rikao

Please Log in or Create an account to join the conversation.

  • hide10
  • Topic Author
  • Offline
  • Elite Member
  • Elite Member
More
4 days 8 hours ago #171835 by hide10
Replied by hide10 on topic Conditional Text in emails
Hello again,

My issue was resolved by using the "[TICKET_NUMBER]>0", instead of "[TICKET_NUMBER]~0".

Thanks,
rikao

Please Log in or Create an account to join the conversation.

More
4 days 8 hours ago #171836 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Conditional Text in emails
Could you please try to change it to the below condition to see if it works? In this case, [TICKET_NUMBER] is an empty string, so we should use greater than 0 condition
Code:
{ebShowText [TICKET_NUMBER]gt0} <p><a href="[DOWNLOAD_TICKET_LINK]">Download your ticket</a></p> {/ebShowText}

Regards,

Tuan

Please Log in or Create an account to join the conversation.

More
4 days 8 hours ago #171837 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Conditional Text in emails
Yes, that works. But sometime, editor change > character to it's html entity, so maybe you should replace it by gt to be safe.

But if it is not being changed by editor, then you can keep it as how it is

Regards,

Tuan

Please Log in or Create an account to join the conversation.

  • hide10
  • Topic Author
  • Offline
  • Elite Member
  • Elite Member
More
4 days 7 hours ago #171838 by hide10
Replied by hide10 on topic Conditional Text in emails
Thank you for your advice!
I replaced it with "gt" :)

This conditional text feature is very useful, by the way. Thank you!!

rikao

Please Log in or Create an account to join the conversation.

More
4 days 7 hours ago #171839 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Conditional Text in emails
You're welcome

Tuan

Please Log in or Create an account to join the conversation.

Moderators: Tuan Pham Ngoc