Member Junction
    Preparing search index...

    Implementation of the MS Graph provider for sending and receiving messages.

    Microsoft Graph provides full mailbox access. This provider supports:

    • Sending messages
    • Fetching messages from inbox
    • Forwarding messages
    • Replying to messages
    • Creating drafts
    // Using environment credentials (default)
    await engine.SendSingleMessage('Microsoft Graph', 'Standard Email', message);

    // Using per-request credentials
    await engine.SendSingleMessage('Microsoft Graph', 'Standard Email', message, undefined, false, {
    tenantId: 'customer-tenant-id',
    clientId: 'customer-client-id',
    clientSecret: 'customer-client-secret',
    accountEmail: 'customer@domain.com'
    });

    Hierarchy (View Summary)

    Index

    Constructors

    Accessors

    • get ProviderName(): string

      Returns the name of this provider for use in error messages. Override in subclasses to provide a more descriptive name.

      Returns string

    Methods

    • Protected

      Gets headers using default client.

      Parameters

      • params: GetMessagesParams
      • user: { id?: string; userPrincipalName?: string }
      • messageID: string

      Returns Promise<Record<string, string>>

      MS Graph Scope: Mail.Read (Application)

    • Protected

      Gets headers for a message using User object (requires prior user lookup). For better performance, consider using GetHeadersWithEmail() instead.

      Parameters

      • client: Client
      • params: GetMessagesParams
      • user: { id?: string; userPrincipalName?: string }
      • messageID: string

      Returns Promise<Record<string, string>>

      MS Graph Scope: Mail.Read (Application)

    • Protected

      Gets headers for a specific message using email address directly. This is the preferred method for new code as it avoids an extra API call to look up the user.

      Parameters

      Returns Promise<Record<string, string>>

      MS Graph Scope: Mail.Read (Application)

    • Protected

      Gets the service account using default client. Caches the result for subsequent calls.

      Parameters

      • Optionalemail: string

      Returns Promise<{ id?: string; userPrincipalName?: string }>

      MS Graph Scope: User.Read.All (Application) - Required to look up user information

    • Protected

      Gets the user account information by making an API call to MS Graph. This method looks up the full User object from the Graph API.

      Parameters

      • client: Client
      • email: string

      Returns Promise<{ id?: string; userPrincipalName?: string }>

      MS Graph Scope: User.Read.All (Application) - Required to look up user information

    • Protected

      Marks a message as read using default client.

      Parameters

      • userID: string
      • messageID: string

      Returns Promise<boolean>

      MS Graph Scope: Mail.ReadWrite (Application)

    • Protected

      Marks a message as read using User ID. For better performance, consider using MarkMessageAsReadWithEmail() instead.

      Parameters

      • client: Client
      • userID: string
      • messageID: string

      Returns Promise<boolean>

      MS Graph Scope: Mail.ReadWrite (Application)

    • Protected

      Marks a message as read using email address directly. This is the preferred method for new code as it avoids an extra API call to look up the user.

      Parameters

      • client: Client
      • emailAddress: string
      • messageID: string

      Returns Promise<boolean>

      MS Graph Scope: Mail.ReadWrite (Application)