Skip to content

Latest commit

 

History

History
53 lines (36 loc) · 2.18 KB

File metadata and controls

53 lines (36 loc) · 2.18 KB
title description ms.date author ms.author ms.reviewer ms.topic search.audienceType contributors
Sample: Send an email using a template (Microsoft Dataverse) | Microsoft Docs
This sample shows how to send an email message by using a template.
04/03/2022
JimDaly
jdaly
pehecke
sample
developer
JimDaly
phecke

Sample: Send an email using a template

This sample shows how to send an email message by using a template using the SendEmailFromTemplateRequest message.

[!div class="nextstepaction"] SDK for .NET: Send an email using a template sample code

How to run this sample

[!includecc-how-to-run-samples]

What this sample does

The SendEmailFromTemplateRequest message is intended to be used in a scenario where it contains data that is needed to send an email message using a template.

How this sample works

In order to simulate the scenario described in What this sample does, the sample will do the following:

Setup

  1. Checks for the current version of the org.
  2. Creates a contact record to send an email to (To: column).

Demonstrate

  1. The ActivityParty creates the From: and To: activity party for the email.
  2. Creates an email message.
  3. The QueryExpression queries to get one of the email template of type Contact.
  4. The SendEmailFromTemplateRequest sends an email message by using a template.

Clean up

Display an option to delete the sample data that is created in Setup. The deletion is optional in case you want to examine the tables and data created by the sample. You can manually delete the records to achieve the same result.

[!INCLUDEfooter-include]