Operation: CreateDraftMail
The CreateDraftMail operation creates an email draft.
Input
The adapter expects the following XML structure as input:
Example
<?xml version="1.0" encoding="UTF-8"?>
<CreateDraft>
<Subject></Subject>
<Message type="text|html"></Message>
<ToRecipients>
<Recipient></Recipient>
<Recipient></Recipient>
</ToRecipients>
<!-- ###Optional### -->
<CcRecipients>
<Recipient></Recipient>
<Recipient></Recipient>
</CcRecipients>
<!-- ###Optional### -->
<BccRecipients>
<Recipient></Recipient>
<Recipient></Recipient>
</BccRecipients>
<!-- ###Optional -->
<Importance>high|normal|low</Importance>
<!-- ###Optional### -->
<Attachments>
<Attachment>
<FileName></FileName>
<FileData></FileData>
</Attachment>
</Attachments>
</CreateDraft>
The following elements can be included in the input:
Element | Description |
|---|---|
| Enclosing element for the |
| Subject of the email Possible values:
|
| The type of the message is defined via the Possible values:
Note:The input for Examples:
XML
XML
|
| Recipient of the email. Contains one or more |
| Email address of the recipient Possible value:
Example:
|
| (optional) Recipient of the email in copy (Cc). The |
Bcc | (optional) Recipient of the email in blind copy (Bcc). The |
| (optional) Importance level of the email Possible values:
|
| (optional) The |
| (optional) The |
| (optional) File name of the attachment |
| (optional) Content of the attachment in base64 format |
Output
The email draft is saved in the Drafts folder.
The adapter generates the following XML document as output:
Example
<?xml version="1.0" encoding="UTF-8"?>
<CreateDraft>
<Object>
<Value name="@odata.context" type="String">https://graph.microsoft.com/v1.0/$metadata#users('test.user%40softproject.de')/messages/$entity</Value>
<Value name="@odata.etag" type="String">W/"CQAAABYAAACRrcaFxKxcR7F2mRmZk4TVAAC6T6wA"</Value>
<Value name="id" type="String">AAMkAGI0NDU3YTMxLTVkOTktNGQ2Zi04OGViLTgzNWM1YWFlNjAwNwBGAAAAAABqZX6HQaolT792ILCaL-z8BwCRrcaFxKxcR7F2mRmZk4TVAAAAAAEPAACRrcaFxKxcR7F2mRmZk4TVAAC6rA52AAA=</Value>
<Value name="createdDateTime" type="String">2023-06-29T14:22:32Z</Value>
<Value name="lastModifiedDateTime" type="String">2023-06-29T14:22:32Z</Value>
<Value name="changeKey" type="String">CQAAABYAAACRrcaFxKxcR7F2mRmZk4TVAAC6T6wA</Value>
<Array name="categories"/>
<Value name="receivedDateTime" type="String">2023-06-29T14:22:32Z</Value>
<Value name="sentDateTime" type="String">2023-06-29T14:22:32Z</Value>
<Value name="hasAttachments" type="Boolean">false</Value>
<Value name="internetMessageId" type="String"><GV1P193MB231298AC39075A87CA87D95CEF25A@GV1P193MB2312.EURP193.PROD.OUTLOOK.COM></Value>
<Value name="subject" type="String">Unit-Test - Creating a draft mail</Value>
<Value name="bodyPreview" type="String">Hello, this is a Unit-Test! Test for creating and sending a draft mail</Value>
<Value name="importance" type="String">normal</Value>
<Value name="parentFolderId" type="String">AAMkAGI0NDU3YTMxLTVkOTktNGQ2Zi04OGViLTgzNWM1YWFlNjAwNwAuAAAAAABqZX6HQaolT792ILCaL-z8AQCRrcaFxKxcR7F2mRmZk4TVAAAAAAEPAAA=</Value>
<Value name="conversationId" type="String">AAQkAGI0NDU3YTMxLTVkOTktNGQ2Zi04OGViLTgzNWM1YWFlNjAwNwAQAMvXRjjTgmVNv6d_qGfIB0M=</Value>
<Value name="conversationIndex" type="String">AQHZqpUky9dGONOCZU2/p36oZ8gHQw==</Value>
<Value name="isDeliveryReceiptRequested" type="Boolean">false</Value>
<Value name="isReadReceiptRequested" type="Boolean">false</Value>
<Value name="isRead" type="Boolean">true</Value>
<Value name="isDraft" type="Boolean">true</Value>
<Value name="webLink" type="String">https://outlook.office365.com/owa/?ItemID=AAMkAGI0NDU3YTMxLTVkOTktNGQ2Zi04OGViLTgzNWM1YWFlNjAwNwBGAAAAAABqZX6HQaolT792ILCaL%2Fz8BwCRrcaFxKxcR7F2mRmZk4TVAAAAAAEPAACRrcaFxKxcR7F2mRmZk4TVAAC6rA52AAA%3D&exvsurl=1&viewmodel=ReadMessageItem</Value>
<Value name="inferenceClassification" type="String">focused</Value>
<Object name="body">
<Value name="contentType" type="String">text</Value>
<Value name="content" type="String">Hello, this is a Unit-Test! Test for creating and sending a draft mail</Value>
</Object>
<Array name="toRecipients">
<Object>
<Object name="emailAddress">
<Value name="name" type="String">Test User</Value>
<Value name="address" type="String">test.user@softproject.de</Value>
</Object>
</Object>
</Array>
<Array name="ccRecipients"/>
<Array name="bccRecipients"/>
<Array name="replyTo"/>
<Object name="flag">
<Value name="flagStatus" type="String">notFlagged</Value>
</Object>
</Object>
</CreateDraft>
Note:
Included in the output is metadata provided by MS Graph. You can find more information about this metadata in the official MS Graph documentation: https://learn.microsoft.com/en-us/graph/
The following elements and attributes can be included in the output:
Element | Description |
|---|---|
| Enclosing element for the output of the |
| Enclosing element for the |
| The Possible name attributes:
The
|
| Specifies the body of the email. Further
|
| Array with specification of recipients, recipients in copy, and recipients in blind copy with email address and name.
|
| Indicates name and email address of the recipients ( |
| Indicates flagged or non-flagged elements. In the
Possible values for
|