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 |
|
|
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
[!includecc-how-to-run-samples]
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.
In order to simulate the scenario described in What this sample does, the sample will do the following:
- Checks for the current version of the org.
- Creates a contact record to send an email to (To: column).
- The
ActivityParty
creates theFrom:
andTo:
activity party for the email. - Creates an email message.
- The
QueryExpression
queries to get one of the email template of typeContact
. - The
SendEmailFromTemplateRequest
sends an email message by using a template.
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]