web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics 365 | Integration, Dataverse...
Answered

Building a hyperlink in email template adds span tags around dynamics text

(6) ShareShare
ReportReport
Posted on by 66
Hello,
 
I have an email template that I want to use by inserting in an email that is sent out from Dynamics.
 
The email template has some generic text, thanking the customer etc.., and at the very end I am dynamically building a hyperlink that has the name of the person and case # in the URL.
These two placeholders are inserted through the Insert Dynamic Text button in the email template.
The hyperlink is build OK and the values for the two placeholders are showing as well except that around these two values a <span></span> is added before and after. When the user click the URL Chrome opens with a blank page but if the user manually removes the <span> and </span> in the URL all works fine.
 
1-2 month ago this worked with no issues and suddenly it seems that it starting doing this.
 
Templates that we have made 1-2 month ago and did not touch since are not affected by this behavior,
 
It looked as if something changed in the email template editor.
Incorrect URL
https://nam.dcv.ms/99999999?lang=en-us&ctx=%7B%22Case'%3A'<span>FD-INC-99999</span>'%2C'First%20Name'%3A'<span>Joe Smith</span>'%7D
Removing spans makes it work
https://nam.dcv.ms/99999999?lang=en-us&ctx=%7B%22Case'%3A'FD-INC-99999'%2C'First%20Name'%3A'oe Smith'%7D
 
Thank you for your suggestions
Categories:
I have the same question (0)
  • André Arnaud de Calavon Profile Picture
    300,911 Super User 2025 Season 2 on at
    Hi,
     
    Can you tell us what Dynamics 365 application this question is related to? There are several different solutions in the Dynamics 365 family, like: Sales, Finance, Supply Chain Management, Project Operations, and Business Central. 
  • FM-22040757-0 Profile Picture
    66 on at
    Hello,
     
    I am experiencing this issue in Customer Service and Sales Apps.
  • RP-16042019-0 Profile Picture
    14 on at
    Hi Team Microsoft.
     
    Wondering if there is any solution to what 'FM-22040757-0' posted a couple days ago?  We are noticing <span> tags within our link that we embed in our email template within Dynamics customer service app. (the link is not rendering). 
     
    Thank you.
    Russ Pereira
  • Honbo Profile Picture
    15 on at
    Hello,

    I can confirm the hyperlink bug in our environment, this is in Dynamics 365 Sales, all of our email templates with dynamic values in links are now broken with extra <span> tags added.
     
    Related to this, Microsoft has mismatching documentation, this page mentions "To include data fields in a hyperlink", so it should be supported: 

    https://learn.microsoft.com/en-us/power-platform/admin/create-templates-email


    While this page, it mentions "Dynamic text in a hyperlink or an anchor tag isn't supported": 

    https://learn.microsoft.com/en-us/power-apps/user/email-dynamic-text



    So which one is it?? Are dynamic texts in hyperlinks supported or not?

     
  • Sam Conroy Profile Picture
    274 on at
    We are also getting this in our Dynamics 365 Sales/CE environments.
    Looks like it's been happening for a while now and the only alternative is to build the email into a Power Automate Flow.
    If anyone has any suggestions to make it work in a traditional email template please let us know
  • Verified answer
    FM-22040757-0 Profile Picture
    66 on at
    Hi Sam,
     
    What I ended up doing was creating a virtual/calculated column where I do the concatenation and then I am sending this field in the email as there is no need anymore to concatenate.
    I
  • Verified answer
    Muhammad Shahzad Shafique Profile Picture
    2,373 Most Valuable Professional on at
    This avoids the <span> issue completely since the email editor isn’t trying to wrap individual dynamic fields. So far, this workaround has been working consistently without breaking.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Microsoft Dynamics 365 | Integration, Dataverse, and general topics

#1
Siv Sagar Profile Picture

Siv Sagar 93 Super User 2025 Season 2

#2
#ManoVerse Profile Picture

#ManoVerse 76

#3
Martin Dráb Profile Picture

Martin Dráb 64 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans