Skip to main content

Hello,

Wondering if it’s possible to add if/then logic to our Agent Reply Template, so that it shows the Internal Ticket link if the Requester email includes our domain, and External Ticket link if email does not include our domain?

Example scenario:

“To reply or see the current Status of your ticket, please visit one of our support portal options below:”
*TICKET LINK PLACEHOLDER*

Certainly! Here's how you can modify the Agent Reply Template to include if/then logic for displaying the appropriate ticket link based on the requester's email domain:

```plaintext
Hello,

To reply or see the current status of your ticket, please visit one of our support portal options below:

{% if requester_email contains '@yourdomain.com' %}
Internal Ticket Link: *INSERT INTERNAL TICKET LINK HERE*
{% else %}
External Ticket Link: *INSERT EXTERNAL TICKET LINK HERE*
{% endif %}
```

In this modified template:
- `{% if requester_email contains '@yourdomain.com' %}` checks if the requester's email contains your domain. If it does, it displays the internal ticket link.
- `{% else %}` covers the case where the requester's email does not contain your domain, and it displays the external ticket link.
- Replace `*INSERT INTERNAL TICKET LINK HERE*` and `*INSERT EXTERNAL TICKET LINK HERE*` with the actual URLs of your internal and external ticket links, respectively.

This modification will dynamically display the appropriate ticket link based on whether the requester's email includes your domain or not.


Certainly! Here's how you can modify the Agent Reply Template to include if/then logic for displaying the appropriate ticket link based on the requester's email domain:

```plaintext
Hello,

To reply or see the current status of your ticket, please visit one of our support portal options below:

{% if requester_email contains '@yourdomain.com' %}
Internal Ticket Link: *INSERT INTERNAL TICKET LINK HERE*
{% else %}
External Ticket Link: *INSERT EXTERNAL TICKET LINK HERE*
{% endif %}
```

In this modified template:
- `{% if requester_email contains '@yourdomain.com' %}` checks if the requester's email contains your domain. If it does, it displays the internal ticket link.
- `{% else %}` covers the case where the requester's email does not contain your domain, and it displays the external ticket link.
- Replace `*INSERT INTERNAL TICKET LINK HERE*` and `*INSERT EXTERNAL TICKET LINK HERE*` with the actual URLs of your internal and external ticket links, respectively.

This modification will dynamically display the appropriate ticket link based on whether the requester's email includes your domain or not.

Hi JohnAllen1,

Thanks so much for your reply.  I used your code and it definitely is very close to working for me.  The only problem is that I can’t seem to get the IF condition working.  It always spits out the ELSE output.  I’ve put in different permutations of  '@yourdomain.com', with and without the ‘  ‘, substituting “  “, etc.  Am I missing something?


Thanks again to JohnAllen1 - I was able to figure it out with your syntax.  The “requester_email” variable suggested didn’t work.  This is how I got it to work:

------------------

Dear {{ticket.requester.name}},

***AGENT MESSAGE HERE*** <hr>

To reply or see the current Status of your ticket, please click the following link:

{% if {{ticket.from_email}} contains '@yourdomain.com' %}({{ticket.id}}) {{ticket.subject}}{% else %}({{ticket.id}}) {{ticket.subject}}{% endif %}
--------------------

The bolded hyperlinks go to {{ticket.url}} for internals, else to {{ticket.public_url}} for externals.  End result to the Requester looks like this with the proper internal or external link depending on the Requester email address domain:

 


Reply