When using Send an email (v2) and viewing in Code View, I add a Dynamic field to the content (i.e. a hyperlink a href="<dynamic field>") but when I change the view back Html View it changes the whole email body.
For example code view will turn from this:
<a href="http://system.domain.com/index.php?id=[Dynamic Content]&code=[Dynamic Content]">click here</a>
Changed into this:
[Dynamic Content]<a href="http://system.domain.com/index.php?id=<object custom=">&code=</a>[Dynamic Content]<a href="href="http://system.domain.com/index.php?id=<object custom=">">click here</a>
Absoultely no idea how this happens.. But if I set the code view with the Dynamic Content and Save the Flow, it will work.
However next time I open the Send an email (V2) step it displays as above...
Solved! Go to Solution.
I used an expression inside the email body using concat function:
concat('<a href="https://{url first part}',variables('myvar'),'{url last part}">Description</a>'
After you save, just use peek code for the Send an email (V2) and see the html body.
It was tested and working until they solve the email body editor.
I solved a similar problem by using a variable. I initialized a variable varHtmlLinkToItem like this:
then I added this variable in the html view of the Send an Email (v2) action:
Hi @jasonbic ,
If you want to add a similar hyperlink tag to email body, it is recommended to use Send an email action directly and set Is html field to Yes.
In addition, if you are configuring a hyperlink in Send an email (V2) action, please manually configure Link Title and Link Target using the feature provided in the editing tool.
Image refernece:
Best Regards,
@v-bacao-msftthank you for your response.
Is there a reason Send an email is recommended over Send an email (V2)?
Additionally, you cannot add Dynamic Content when using Link Title and Link Target.
Hi,
Recently 'send an email' has been depreciated and it is still not possible to ad dynamic content to a hyperlink in send an email V2. Will this be added soon? We send a link to a sharepoint item in emails, and this is not useable anymore.
thanks
We have this issue as well. Can't select the old send email, and can't send any new dynamic links now.
This is kind of a big deal... I'm using the new V2 Send and email actions but my carefully crafted HTML email gets hosed the moment I add a simple link that contains the item's ID appended to the URL as a query string parameter.
Isn't this one of the simplest and most typical uses of Flow? How can this just straight up not work properly?
This is not "Solved" by the way.
Still not working, this need to be be fixed.
Either allow dynamic content to be used in the link target or the ability to set Is html on the on the mail.
With the "Send an Email"-actiongone this is really frustrating when you ned to create links based on dynamic content...
I used an expression inside the email body using concat function:
concat('<a href="https://{url first part}',variables('myvar'),'{url last part}">Description</a>'
After you save, just use peek code for the Send an email (V2) and see the html body.
It was tested and working until they solve the email body editor.
works for me.
Hi @NirolfD , can you explain how to obtain the url first part and url last part?
And what should replace the 'myvar' ?
Thanks
Hi @aanyoti ,
If you want to send a link with a record in CRM you need to send to the user something like this:
https://YourOrg.crm4.dynamics.com/main.aspx?app=d365default&forceUCI=1&pagetype=entityrecord&etn=account&id=0c223724-1f21-46b4-95cb-9d31f38c030f
In this case, the url has only 2 parts: green and red.
In the proposed solution myvar is a name for a variable defined inside Flow. You don't necessarily need a variable for this.
You can get the link from your browser after you open the record in CRM.
Could the workaround proposed by @NirolfD be marked at the solution until this is fixed please? The original solution is not up-to-date any more
I solved a similar problem by using a variable. I initialized a variable varHtmlLinkToItem like this:
then I added this variable in the html view of the Send an Email (v2) action:
That works great, thanks!
Hi @NirolfD ,
Thanks for sharing this solution.
I am using same expression in Send an Email (V2) but, concat does not work with variable. I am writing following expression.
('<a href="https:// xxxjira.xxx.xxx.corp/browse/',variables('varkey')"></a>'
I have initiated 'varkey' earlier and its value is coming from an Excel. It gets the message 'The expression is invalid'.
Any clue what might be wrong?
Thank you!
Best regards,
Zainab
Hi @Anonymous ,
Your expression is missing some chars:
('<a href="https:// xxxjira.xxx.xxx.corp/browse/',variables('varkey'),'">Put the name of the link here</a>')
After 'varkey') you need a comma and an apostrophe.
Regards
Thank you big time !!!! @NirolfD
Is there any way I can use dynamic text for name of the link?
The same Excel that has this variable part of the link, has different names for different links.
For example, the Excel contains employee records. The email asks Employee A to update his Address(hyperlinked text). Another email asks Employee B to update his Police(hyperlinked text) record.
I have tried to initiate another variable and use that for 'link name' but that doesn't work.
Best regards,
Zainab
Hi @Anonymous ,
The formula should look like:
('<a href="https:// xxxjira.xxx.xxx.corp/browse/',variables('varkey'),'">',variables('linkName'),'</a>')
This now will have as link text the value from the variable linkName.
Regards
Thank you A LOTTT!!!! @NirolfD
Nothing I found online could work for me except the concat expression you mentioned above. And then you also solved my next problem!!!
I can't thank you enough!! 😄
Have a wonderful weekend!!
Best regards,
Zainab
User | Count |
---|---|
95 | |
45 | |
21 | |
18 | |
17 |
User | Count |
---|---|
142 | |
50 | |
43 | |
40 | |
31 |