Skip to main content

Notifications

Finance | Project Operations, Human Resources, ...
Suggested answer

How to send email with d365fo URL using x++ code

Posted on by 93
Hi All,

I have written code to send email for PO Confirmation. It's working fine.
Now the requirement is to send mail with URL. Upon clicking the Link, it should take to the related PO page.
Using placeholders we are setting the body.

 
Front end setup:
 

I don't know how to set Web link in the email body.
Can anyone help me how to acheive this using x++?
 
Thanks in advance.
 
  • Suggested answer
    Komi Siabi Profile Picture
    Komi Siabi 12,686 Most Valuable Professional on at
    How to send email with d365fo URL using x++ code
  • Martin Dráb Profile Picture
    Martin Dráb 230,149 Most Valuable Professional on at
    How to send email with d365fo URL using x++ code
    I'm assuming that builder is an instance of SysMailerMessageBuilder class. If so, the second parameter of setBody() says whether it's HTML code. It's true by default, so you don't need to change it. In HTML, you can use "a" element with "href" attribute to define a link.
     
    To create the URL, you can utilize UrlGenerator class.

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,240 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,149 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans