Login to follow
Simple Email Connector (Microsoft Graph API)

Simple Email Connector (Microsoft Graph API) (ODC)

Stable version 0.2.1 (Compatible with ODC)
Uploaded on 3 Mar by Azli Razali
Simple Email Connector (Microsoft Graph API)

Simple Email Connector (Microsoft Graph API) (ODC)

Documentation
0.2.1

Installation

  1. Install ‘Simple Email Connector’ from Forge into your ODC workspace.

  2. Open your app and add a dependency to the library (tick/include all).

  3. Publish your app.

Azure prerequisites (must do in Microsoft Entra/Azure)

  1. Create an App Registration (single-tenant or as required).

  2. Add Microsoft Graph → Application permission → Mail.Send.

  3. Click Grant admin consent.

  4. Create a Client secret (note its value and expiry) or use a certificate.

  5. Ensure the sender mailbox exists (e.g., noreply@yourdomain.com) and that org policies allow app-only send.

  6. Token scope used by the connector is .default for Graph.

Configuration in ODC

In your app’s Application Settings (secrets), set:

  • Email_ClientId = your Azure App Registration client ID

  • Email_ClientSecret = client secret value

  • Email_TenantId = your tenant ID (GUID)

  • Email_FromEmailAddress = Sender (e.g., noreply@yourdomain.com)

  • Email_IsSendToTestEmail = True/False to redirect all sends to a test list

  • Email_TestEmailList = comma-separated emails used when test mode is on


Usage in your server logic

  1. Simply just use the SendMail server action included in the library and pass all the input parameters according to your use case.

Quick test content (HTML)

Use the provided default test HTML in the component. Remember to replace it with your real email content before going live.


Notes and reminders

  • This connector uses app-only (client credentials) with Microsoft Graph. Make sure Mail.Send (Application) is granted and admin consented in Azure.

  • Store all credentials as ODC secrets. Do not expose them in client code.

  • Enable test mode (Email_IsSendToTestEmail = True) while validating flows to avoid accidental emails to real users.

Troubleshooting (fast)

  • 401/invalid_client → check ClientId/ClientSecret/TenantId and token URL format .default.

  • 403/insufficient privileges → confirm Mail.Send (Application) and that admin consent was granted.

  • 404/user not found → verify Email_FromEmailAddress or SenderUpn.

  • 429/throttling → retry later; the connector surfaces Retry-After via StatusCode/ErrorMessage.

  • Large attachments → keep under Graph simple send limits (~3–10 MB); chunked upload isn’t included.