Matterway
    Preparing search index...

    Function createEmailDraft

    • Drafts an email using the Microsoft Graph API.

      Parameters

      • client: Client

        The Microsoft Graph client instance.

      • options: {
            subject: string;
            content: string;
            emailsTo: string[];
            contentType?: string;
            attachments?: MwFile[];
        }

        The options for drafting the email.

        • subject: string

          The subject of the email.

        • content: string

          The content of the email.

        • emailsTo: string[]

          An array of recipient email addresses.

        • OptionalcontentType?: string

          The content type of the email (e.g., 'HTML' or 'Text'). Defaults to 'HTML'.

        • Optionalattachments?: MwFile[]

          An optional array of attachments to include in the email.

      Returns Promise<void>

      A promise that resolves when the email draft is created.

      const client = getMsGraphClient(options);
      const options = {
      subject: 'Meeting Reminder',
      content: '<p>Don\'t forget about our meeting tomorrow at 10am.</p>',
      emailsTo: ['example@example.com'],
      contentType: 'HTML',
      attachments: [sdkFile1, sdkFile2],
      };
      await createEmailDraft(client, options);