Skip to main content

Notifications

Microsoft Dynamics CRM (Archived)

replace email template variables

(0) ShareShare
ReportReport
Posted on by 2,397

Hi, I am wondering how to replace the variables in an email template.  For example, I have the template: " dear {customer: customername}", how to find the variable and replace in c#? 

*This post is locked for comments

  • Verified answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: replace email template variables

    Hi sdnd2000,

    you can do it by OpenXml, in these pages you could find some useful info:

    https://social.msdn.microsoft.com/Forums/en-US/28a2849e-a304-4a1e-9c12-0d6e36ff2ab0/create-word-document-using-document-template-openxml-dll?forum=oxmlsdk 

    https://blogs.msdn.microsoft.com/vsod/2012/02/17/how-to-create-a-document-from-a-template-dotx-dotm-and-attach-to-it-using-open-xml-sdk/ 

    Hope it helps.

    If you found the answer helpful, please mark as Verified 

    Join my network on LinkedIn      Follow me on Twitter 

    Thank You & Best Regards

    Francesco Picchi

    Microsoft Dynamics CRM Consultant, Bologna+Milano, ITALY

    Independent Contractor

    http://www.francescopicchi.com

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

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,965 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 230,836 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans