Jump to content

HTML Links in ESP Conditions


will.good

Recommended Posts

Hi,


When we have typed a paragraph including an HTML link, if we then add an ESP condition to that paragraph, the HTML link is lost?

Not sure if this is a bug as I would expect the link to remain if a paragraph is turned into an esp conditioned text...

 

If not a bug, can we please get this functionality added.

If a use case is needed:

We are going to start using CustomerTimelineUpdateNotification emails on our cases. We have customers that are a mixture of Contacts and Coworkers, we want to be able to email say the ticket "has been updated here is a link to view it on the portal" (for coworkers). For contacts we want to also provide the update using {{RequestLastActivity.H_content}} as they will not have access to Hornbill

Link to comment
Share on other sites

Hi @will.good

I've seen this working before for exactly what you are trying to achieve where URLs are based on if you are an external customer (contact) or an internal customer (user) to send the user to the correct portal. 

When you say "the link is lost" is the text for the link there, but you just can't click on it?  Or is the entire link not visible?


Have you had a look at the source to see if there is anything odd going on there?

image.png

Have a look at the start and end of the ESP condition tags <esp-condition></esp-condition> and make sure that the link is within these tags.

 

Link to comment
Share on other sites

Hi @James Ainsworth

Thanks for getting back to me!

The issue was, when I added the esp condition in, it would remove the hyperlink, so the link wasn't clickable. I had to manually add the HTML element back in using Source as you described, which has worked.

I have run into another issue, albeit unrelated from my original post but on the same email template.

When sending the email to a contact, we want to display the {{session.FirstName}} variable, followed on the next line (after a break) our company name.

E.g.

Kind Regards,

Will

Company name

For customers, we want it just be:

Kind Regards,

Company name

I am trying to edit the source to move <br /> inside the esp condition to be after the {{session.FirstName}} variable, so it would have a line break after the variable is used. But whenever I make this change, it never saves or it just moves <br /> back outside of the esp condition

This is what the source currently looks like:

                                    Kind Regards,<br />
                                    <esp-condition contenteditable="false" expression="{{.h_customer_type}} = 1"><br />
                                    {{session.FirstName}}</esp-condition></span></span><br />
                                    <br />
                                    <esp-condition contenteditable="false" expression="{{.H_fk_serviceid}} = 17"><br />
                                    Franchisee Admin @ </esp-condition><esp-condition contenteditable="false" expression="{{.H_fk_serviceid}} = 15"> Salaried Admin @ </esp-condition> <span style="font-size:14px;"><span style="font-family:Calibri,Verdana,Geneva,sans-serif;">People Services Helpdesk</span></span></td>
 

This is how I believe it should look with the edits I am trying to make:

                                    Kind Regards,<br />
                                    <esp-condition contenteditable="false" expression="{{.h_customer_type}} = 1"><br />
                                    {{session.FirstName}}<br /></esp-condition></span></span>
                                    <br />
                                    <esp-condition contenteditable="false" expression="{{.H_fk_serviceid}} = 17"><br />
                                    Franchisee Admin @ </esp-condition><esp-condition contenteditable="false" expression="{{.H_fk_serviceid}} = 15"> Salaried Admin @ </esp-condition> <span style="font-size:14px;"><span style="font-family:Calibri,Verdana,Geneva,sans-serif;">People Services Helpdesk</span></span></td>

 

I feel I must be missing something obvious because I don't think it should be this difficult :D I can put in <br /> at the start of an esp condition with no problems, it seems to not like it at the end

Link to comment
Share on other sites

If I use <br> instead in Source it lets me save, but doesn't keep this inside the esp condition 🥲 Have even tried clicking save when not in source mode.

Also when I have tried <br> it always changes back to <br /> when I have gone back into source mode

image.png.791dfa6415811dcec3bf9b29a1251db0.png

Link to comment
Share on other sites

Hi @will.good

I've taken a copy of the source that you provided and when I save it, the original placing of the <br /> is still the same.

The one thing it did do is remove the two </span> tags on this line and the final </td> tag at the very end as it must have identified that there weren't opening tags for these.  This suggests to me that there are some automatic tweaks being done to fix what is perceived as an issue.

It might be there there is something a little further up the email template that is causing a knock-on effect.  After saving your original source content this is what I was left with:

Kind Regards,<br />
<esp-condition contenteditable="false" expression="{{.h_customer_type}} = 1"><br />
{{session.FirstName}}</esp-condition><br />
<br />
<esp-condition contenteditable="false" expression="{{.H_fk_serviceid}} = 17"><br />
Franchisee Admin @ </esp-condition><esp-condition contenteditable="false" expression="{{.H_fk_serviceid}} = 15"> Salaried Admin @ </esp-condition> <span style="font-size:14px;"><span style="font-family:Calibri,Verdana,Geneva,sans-serif;">People Services Helpdesk</span></span>

Link to comment
Share on other sites

I've tried this, but am still not getting anywhere 🥲

I have retyped the email on a new template, removed all formatting, but are still unable to move a <br /> inside the esp conditions. No option to save and when going out of source mode and then back in my changes are gone

image.thumb.gif.08410ce6292672ae36e251c6ae647d13.gif

Link to comment
Share on other sites

After moving the <br /> to before the </esp-condition> tag if I include some text after the <br /> stays where I put it.  This suggests to me that there is some validation going on where it doesn't like a <br /> within a <esp-condition> tag unless it has text to go on the next line after the <br />.

image.png

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...