Skip to main content

Outlook Integration Guide

Overview

The Outlook integration allows your NINA workflows to connect with Microsoft Outlook via the Microsoft Graph API. This integration enables you to send and manage emails, create and track calendar events, and maintain contacts - all directly from your workflows.

Status

The Microsoft Graph API offers a wide range of functionalities. At present, our integration comprehensively supports key endpoints related to email management, calendar operations, and contact handling.

Credential Configuration

Before using the Outlook integration in your workflows, you need to configure OAuth2 credentials for authentication. This requires setting up an application in the Microsoft Azure Portal.

Setting Up Microsoft Azure App Registration

  1. Go to the Azure Portal
  2. Navigate to Azure Active DirectoryApp registrations
  3. Click + New registration
  4. Enter a name for your application (e.g., "NINA Outlook Integration")
  5. Set the appropriate Redirect URI:
    • For POC environment: https://poc.zynap.com/api/v1/oauth2/callback
    • For Production environment: https://platform.zynap.com/api/v1/oauth2/callback
  6. Click Register
  7. After registration, note down the following values:
    • Application (client) ID
    • Directory (tenant) ID
  8. Create a client secret:
    • Go to Certificates & secrets
    • Click + New client secret
    • Add a description and select an expiration period
    • Click Add
    • IMPORTANT: Copy the client secret value immediately, as it will not be shown again

Required API Permissions

  1. In your registered application, go to API permissions
  2. Click + Add a permission
  3. Select Microsoft Graph
  4. Choose Delegated permissions
  5. Add the following permissions:
    • Mail.ReadWrite - To read and create emails
    • Mail.Send - To send emails
    • Calendars.ReadWrite - To manage calendar events
    • Contacts.ReadWrite - To manage contacts
    • User.Read - Basic user profile information
    • offline_access - For refresh tokens
  6. Click Add permissions
  7. Click Grant admin consent (may require admin privileges)

Creating an Outlook Credential in NINA

  1. Navigate to the Credentials section in NINA

  2. Click Add New Credential

  3. Fill in the credential details:

    • Name: A descriptive name (e.g., "Outlook Production")
    • Description: Optional details about the credential's purpose
    • Integration Service: Select "Outlook"
    • Auth Type: "OAuth2" (only option available for Outlook)
    • Client ID: The Application (client) ID from Azure
    • Client Secret: The client secret you generated
    • Scope: offline_access User.Read Mail.ReadWrite Mail.Send Calendars.ReadWrite Contacts.ReadWrite
    • Access Token URL: https://login.microsoftonline.com/common/oauth2/v2.0/token
    • Auth URL: https://login.microsoftonline.com/common/oauth2/v2.0/authorize
  4. Click Authorize to start the OAuth2 flow

  5. Sign in to your Microsoft account when prompted

  6. Review and accept the requested permissions

  7. After successful authorization, click Save to store the credential

Supported Resources and Operations

The Outlook integration supports the following resources and operations:

Message

OperationDescription
Create DraftCreates a new draft email message
Send EmailSends a new email message
Get EmailRetrieves details of a specific email
Get All EmailsSearches for and retrieves multiple emails
Update EmailUpdates an existing email message
Delete EmailDeletes an email message

Message Rule

OperationDescription
List RulesLists inbox message rules
Get RuleRetrieves details of a specific message rule
Create RuleCreates a new message rule
Update RuleUpdates an existing message rule
Delete RuleDeletes a message rule

Calendar

OperationDescription
Create EventCreates a new calendar event
Get EventRetrieves details of a specific event
Get All EventsSearches for and retrieves multiple events
Update EventUpdates an existing calendar event
Delete EventDeletes a calendar event

Contact

OperationDescription
Create ContactCreates a new contact
Get ContactRetrieves details of a specific contact
Get All ContactsSearches for and retrieves multiple contacts
Update ContactUpdates an existing contact
Delete ContactDeletes a contact

Mail Folder

OperationDescription
Create Mail FolderCreates a new mail folder
Get Mail FolderRetrieves details of a specific mail folder
Get All Mail FoldersLists all mail folders
Update Mail FolderUpdates an existing mail folder
Delete Mail FolderDeletes a mail folder

Attachment

OperationDescription
List AttachmentsRetrieves all attachments from a specific message
Get AttachmentRetrieves details of a specific attachment

Parameter Merging and Templating

The Outlook integration takes full advantage of NINA's parameter merging and templating capabilities:

Parameter Sources (in order of precedence)

  1. Node Parameters: Parameters configured directly in the Outlook Integration Node
  2. Extracted Parameters: Parameters automatically extracted from the input data
  3. Input Data: The complete input data from upstream nodes

When an Outlook Integration Node executes:

  • It combines parameters from all sources
  • Node parameters take precedence over extracted parameters
  • Template variables within parameters are processed (using {{variable_name}} syntax)
  • The combined parameters are used to execute the Outlook operation

Example: Sending Emails

Basic Email Sending

Below is an example of sending a basic email message:

Node Configuration:

{
"integration_service": "outlook",
"resource": "message",
"operation": "send",
"parameters": {
"subject": "Important Security Alert",
"bodyContent": "<h1>Security Alert</h1><p>We've detected unusual activity in your account.</p>",
"bodyContentType": "html",
"to": ["[email protected]"],
"additionalFields": {
"cc": ["[email protected]"],
"importance": "high"
}
}
}

Sending Email with Attachments

You can include file attachments in your emails:

Node Configuration:

{
"integration_service": "outlook",
"resource": "message",
"operation": "send",
"parameters": {
"subject": "Monthly Security Report",
"bodyContent": "<p>Please find attached the security report for this month.</p>",
"bodyContentType": "html",
"to": ["[email protected]"],
"additionalFields": {
"attachments": [
{
"name": "security-report.pdf",
"contentType": "application/pdf",
"contentBytes": "BASE64_ENCODED_FILE_CONTENT_HERE"
},
{
"name": "vulnerabilities.xlsx",
"contentType": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
"contentBytes": "BASE64_ENCODED_FILE_CONTENT_HERE"
}
],
"importance": "normal",
"saveToSentItems": true
}
}
}

Personalized Emails Using Template Variables

You can use template variables to create personalized email content:

Input Data from Previous Node:

{
"recipient": {
"email": "[email protected]",
"firstName": "John",
"lastName": "Smith",
"role": "Security Analyst"
},
"report": {
"date": "2024-05-12",
"findings": 5,
"criticalIssues": 2,
"summary": "Multiple critical vulnerabilities detected"
}
}

Node Configuration with Template Variables:

{
"integration_service": "outlook",
"resource": "message",
"operation": "send",
"parameters": {
"subject": "Security Report: {{report.date}} - {{report.summary}}",
"bodyContent": "<h1>Security Report</h1><p>Hello {{recipient.firstName}},</p><p>We've completed the security scan on {{report.date}} and found {{report.findings}} issues, including {{report.criticalIssues}} critical vulnerabilities that require your immediate attention.</p><p>Please review the attached report at your earliest convenience.</p><p>Best regards,<br>Security Team</p>",
"bodyContentType": "html",
"to": ["{{recipient.email}}"],
"additionalFields": {
"importance": "{{report.criticalIssues > 0 ? 'high' : 'normal'}}"
}
}
}

Result:

This will send an email with:

  • Subject: "Security Report: 2024-05-12 - Multiple critical vulnerabilities detected"
  • Personalized greeting: "Hello John,"
  • Dynamic content showing 5 findings and 2 critical issues
  • To: "[email protected]"
  • Importance set to "high" based on the critical issues condition

Example: Email Retrieval and Folder Management

Retrieving Emails from a Specific Folder

Search for emails in a specific folder:

Node Configuration:

{
"integration_service": "outlook",
"resource": "message",
"operation": "getAll",
"parameters": {
"returnAll": false,
"limit": 10,
"filter": {
"folderPath": {
"mode": "id",
"value": "/inbox"
},
"readStatus": "unread",
"select": "id,subject,receivedDateTime,from,hasAttachments",
"orderBy": "receivedDateTime desc"
}
}
}

Retrieving a Specific Email

Get a single email by its ID:

Node Configuration:

{
"integration_service": "outlook",
"resource": "message",
"operation": "get",
"parameters": {
"messageId": "AAMkAGVmMDEzMTM4LTZmYWUtNDdkNC1hMDZiLTU1OGY5OTZhYmY4OABGAAAAAAAiQ8W967B7TKBjgx9rVEURBwAiIsqMbYjsT5e-T7KzowPTAAAAAAEMAAAiIsqMbYjsT5e-T7KzowPTAAAYbvZuAAA=",
"additionalFields": {
"select": "id,subject,body,from,toRecipients,attachments"
}
}
}

Updating Email Read Status

Mark an email as read:

Node Configuration:

{
"integration_service": "outlook",
"resource": "message",
"operation": "update",
"parameters": {
"messageId": "AAMkAGVmMDEzMTM4LTZmYWUtNDdkNC1hMDZiLTU1OGY5OTZhYmY4OABGAAAAAAAiQ8W967B7TKBjgx9rVEURBwAiIsqMbYjsT5e-T7KzowPTAAAAAAEMAAAiIsqMbYjsT5e-T7KzowPTAAAYbvZuAAA=",
"updateFields": {
"isRead": true
}
}
}

Example: Calendar Event Operations

Creating a Calendar Event

Create a new calendar event with attendees:

Node Configuration:

{
"integration_service": "outlook",
"resource": "calendar",
"operation": "create",
"parameters": {
"subject": "Security Incident Review",
"start": "2024-05-15T14:00:00",
"end": "2024-05-15T15:00:00",
"timeZone": "Eastern Standard Time",
"additionalFields": {
"bodyContent": "<p>Meeting to review the security incident from last week.</p><p>Please bring all relevant documentation.</p>",
"bodyContentType": "html",
"location": "Conference Room B",
"isOnlineMeeting": true,
"importance": "high",
"attendees": [
{
"email": "[email protected]",
"type": "required"
},
{
"email": "[email protected]",
"type": "required"
},
{
"email": "[email protected]",
"type": "optional"
}
]
}
}
}

Retrieving Calendar Events

Get upcoming calendar events:

Node Configuration:

{
"integration_service": "outlook",
"resource": "calendar",
"operation": "getAll",
"parameters": {
"returnAll": false,
"limit": 10,
"filter": {
"startDateTime": "2024-05-12T00:00:00Z",
"endDateTime": "2024-05-19T00:00:00Z",
"orderBy": "start/dateTime asc"
}
}
}

Updating a Calendar Event

Update an existing event's details:

Node Configuration:

{
"integration_service": "outlook",
"resource": "calendar",
"operation": "update",
"parameters": {
"eventId": "AAMkAGVmMDEzMTM4LTZmYWUtNDdkNC1hMDZiLTU1OGY5OTZhYmY4OABGAAAAAAAiQ8W967B7TKBjgx9rVEURBwAiIsqMbYjsT5e-T7KzowPTAAAAAAENAAAiIsqMbYjsT5e-T7KzowPTAAAbMOqHAAA=",
"updateFields": {
"subject": "URGENT: Security Incident Review",
"location": "Executive Conference Room",
"start": "2024-05-15T13:30:00",
"end": "2024-05-15T15:30:00",
"timeZone": "Eastern Standard Time",
"bodyContent": "<p><strong>URGENT UPDATE:</strong> Meeting extended to 2 hours and moved to Executive Conference Room. CISO will attend.</p><p>Meeting to review the security incident from last week.</p><p>Please bring all relevant documentation.</p>",
"importance": "high"
}
}
}

Example: Contact Management

Creating a Contact

Create a new contact with detailed information:

Node Configuration:

{
"integration_service": "outlook",
"resource": "contact",
"operation": "create",
"parameters": {
"givenName": "Jane",
"surname": "Doe",
"additionalFields": {
"emailAddresses": [
{
"address": "[email protected]",
"name": "Jane Doe"
},
{
"address": "[email protected]",
"name": "Jane Doe (Personal)"
}
],
"businessPhones": ["+1 (555) 123-4567"],
"mobilePhone": "+1 (555) 987-6543",
"jobTitle": "Chief Information Security Officer",
"companyName": "Acme Corporation",
"department": "Information Security",
"officeLocation": "New York Office"
}
}
}

Retrieving Contacts

Search for contacts:

Node Configuration:

{
"integration_service": "outlook",
"resource": "contact",
"operation": "getAll",
"parameters": {
"returnAll": false,
"limit": 20,
"filter": {
"filterString": "startswith(companyName,'Acme')",
"orderBy": "surname asc"
}
}
}

Updating a Contact

Update an existing contact's information:

Node Configuration:

{
"integration_service": "outlook",
"resource": "contact",
"operation": "update",
"parameters": {
"contactId": "AAMkAGVmMDEzMTM4LTZmYWUtNDdkNC1hMDZiLTU1OGY5OTZhYmY4OABGAAAAAAAiQ8W967B7TKBjgx9rVEURBwAiIsqMbYjsT5e-T7KzowPTAAAAAAEOAAAiIsqMbYjsT5e-T7KzowPTAAAYjQx1AAA=",
"updateFields": {
"jobTitle": "Head of Cybersecurity",
"mobilePhone": "+1 (555) 987-6543",
"companyName": "Acme Security Solutions"
}
}
}

Example: Message Rule Management

Message rules allow you to automatically organize and process incoming emails based on specific conditions. This is particularly useful for security teams to automatically categorize alerts, forward critical notifications, or organize emails into specific folders.

Creating a Message Rule

Create a rule to automatically move security alerts to a dedicated folder:

Node Configuration:

{
"integration_service": "outlook",
"resource": "messageRule",
"operation": "create",
"parameters": {
"displayName": "Security Alert Auto-Organization",
"sequence": 1,
"isEnabled": true,
"conditions": {
"subjectContains": ["SECURITY ALERT", "CRITICAL VULNERABILITY", "INCIDENT"],
"fromAddresses": ["[email protected]", "[email protected]"],
"importance": "high"
},
"actions": {
"moveToFolder": "AAMkAGVmMDEzMTM4LTZmYWUtNDdkNC1hMDZiLTU1OGY5OTZhYmY4OABGAAAAAAAiQ8W967B7TKBjgx9rVEURBwAiIsqMbYjsT5e-T7KzowPTAAAAAAEMAAAiIsqMbYjsT5e-T7KzowPTAAAYbvZuAAA=",
"markAsRead": false,
"markImportance": "high",
"stopProcessingRules": true
}
}
}

Creating a Rule with Forwarding Action

Create a rule to forward critical security incidents to the security team:

Node Configuration:

{
"integration_service": "outlook",
"resource": "messageRule",
"operation": "create",
"parameters": {
"displayName": "Critical Incident Forwarding",
"sequence": 2,
"isEnabled": true,
"conditions": {
"subjectContains": ["CRITICAL INCIDENT", "BREACH DETECTED", "EMERGENCY"],
"bodyOrSubjectContains": ["immediate action required", "urgent response needed"]
},
"actions": {
"forwardTo": ["[email protected]", "[email protected]"],
"markImportance": "high",
"copyToFolder": "AAMkAGVmMDEzMTM4LTZmYWUtNDdkNC1hMDZiLTU1OGY5OTZhYmY4OABGAAAAAAAiQ8W967B7TKBjgx9rVEURBwAiIsqMbYjsT5e-T7KzowPTAAAAAAEMAAAiIsqMbYjsT5e-T7KzowPTAAAYbvZuAAA="
},
"exceptions": {
"senderContains": ["test", "demo"],
"subjectContains": ["TEST", "DEMO"]
}
}
}

Listing Message Rules

Retrieve all existing message rules:

Node Configuration:

{
"integration_service": "outlook",
"resource": "messageRule",
"operation": "list",
"parameters": {
"top": 20,
"skip": 0
}
}

Updating a Message Rule

Modify an existing rule to add new conditions:

Node Configuration:

{
"integration_service": "outlook",
"resource": "messageRule",
"operation": "update",
"parameters": {
"ruleId": "AAMkAGVmMDEzMTM4LTZmYWUtNDdkNC1hMDZiLTU1OGY5OTZhYmY4OABGAAAAAAAiQ8W967B7TKBjgx9rVEURBwAiIsqMbYjsT5e-T7KzowPTAAAAAAEMAAAiIsqMbYjsT5e-T7KzowPTAAAYbvZuAAA=",
"displayName": "Enhanced Security Alert Auto-Organization",
"isEnabled": true,
"conditions": {
"subjectContains": ["SECURITY ALERT", "CRITICAL VULNERABILITY", "INCIDENT", "MALWARE DETECTED"],
"fromAddresses": ["[email protected]", "[email protected]", "[email protected]"],
"importance": "high",
"hasAttachments": false
},
"actions": {
"moveToFolder": "AAMkAGVmMDEzMTM4LTZmYWUtNDdkNC1hMDZiLTU1OGY5OTZhYmY4OABGAAAAAAAiQ8W967B7TKBjgx9rVEURBwAiIsqMbYjsT5e-T7KzowPTAAAAAAEMAAAiIsqMbYjsT5e-T7KzowPTAAAYbvZuAAA=",
"markAsRead": false,
"markImportance": "high",
"stopProcessingRules": true
}
}
}

Example: Mail Folder Management

Mail folders help organize emails into logical categories. This is essential for security teams to maintain organized archives of security communications, incident reports, and compliance documentation.

Creating a Mail Folder

Create a new folder for security incident tracking:

Node Configuration:

{
"integration_service": "outlook",
"resource": "mailFolder",
"operation": "create",
"parameters": {
"displayName": "Security Incidents 2024",
"isHidden": false
}
}

Creating a Subfolder

Create a subfolder within an existing folder:

Node Configuration:

{
"integration_service": "outlook",
"resource": "mailFolder",
"operation": "create",
"parameters": {
"displayName": "Critical Incidents",
"parentFolderId": "AAMkAGVmMDEzMTM4LTZmYWUtNDdkNC1hMDZiLTU1OGY5OTZhYmY4OABGAAAAAAAiQ8W967B7TKBjgx9rVEURBwAiIsqMbYjsT5e-T7KzowPTAAAAAAEMAAAiIsqMbYjsT5e-T7KzowPTAAAYbvZuAAA=",
"isHidden": false
}
}

Listing All Mail Folders

Retrieve all top-level mail folders:

Node Configuration:

{
"integration_service": "outlook",
"resource": "mailFolder",
"operation": "getAll",
"parameters": {
"top": 50,
"select": "id,displayName,childFolderCount,totalItemCount,unreadItemCount",
"orderby": "displayName asc"
}
}

Listing Child Folders

Get all subfolders of a specific parent folder:

Node Configuration:

{
"integration_service": "outlook",
"resource": "mailFolder",
"operation": "getAll",
"parameters": {
"parentFolderId": "AAMkAGVmMDEzMTM4LTZmYWUtNDdkNC1hMDZiLTU1OGY5OTZhYmY4OABGAAAAAAAiQ8W967B7TKBjgx9rVEURBwAiIsqMbYjsT5e-T7KzowPTAAAAAAEMAAAiIsqMbYjsT5e-T7KzowPTAAAYbvZuAAA=",
"top": 20,
"select": "id,displayName,totalItemCount",
"filter": "totalItemCount gt 0"
}
}

Getting a Specific Mail Folder

Retrieve details of a specific folder:

Node Configuration:

{
"integration_service": "outlook",
"resource": "mailFolder",
"operation": "get",
"parameters": {
"folderId": "inbox",
"additionalFields": {
"select": "id,displayName,totalItemCount,unreadItemCount,childFolderCount",
"expand": "childFolders"
}
}
}

Updating a Mail Folder

Rename a mail folder:

Node Configuration:

{
"integration_service": "outlook",
"resource": "mailFolder",
"operation": "update",
"parameters": {
"folderId": "AAMkAGVmMDEzMTM4LTZmYWUtNDdkNC1hMDZiLTU1OGY5OTZhYmY4OABGAAAAAAAiQ8W967B7TKBjgx9rVEURBwAiIsqMbYjsT5e-T7KzowPTAAAAAAEMAAAiIsqMbYjsT5e-T7KzowPTAAAYbvZuAAA=",
"displayName": "Security Incidents Archive 2024",
"isHidden": true
}
}

Example: Attachment Management

Attachments often contain critical security information such as incident reports, vulnerability scans, or forensic evidence. The attachment operations allow you to retrieve and analyze these files programmatically.

Listing Email Attachments

Retrieve all attachments from a specific security incident email:

Node Configuration:

{
"integration_service": "outlook",
"resource": "attachment",
"operation": "list",
"parameters": {
"messageId": "AAMkAGVmMDEzMTM4LTZmYWUtNDdkNC1hMDZiLTU1OGY5OTZhYmY4OABGAAAAAAAiQ8W967B7TKBjgx9rVEURBwAiIsqMbYjsT5e-T7KzowPTAAAAAAEMAAAiIsqMbYjsT5e-T7KzowPTAAAYbvZuAAA=",
"select": "id,name,contentType,size,lastModifiedDateTime",
"top": 10
}
}

Filtering Attachments by Type

List only PDF attachments from an email:

Node Configuration:

{
"integration_service": "outlook",
"resource": "attachment",
"operation": "list",
"parameters": {
"messageId": "AAMkAGVmMDEzMTM4LTZmYWUtNDdkNC1hMDZiLTU1OGY5OTZhYmY4OABGAAAAAAAiQ8W967B7TKBjgx9rVEURBwAiIsqMbYjsT5e-T7KzowPTAAAAAAEMAAAiIsqMbYjsT5e-T7KzowPTAAAYbvZuAAA=",
"filter": "contentType eq 'application/pdf'",
"select": "id,name,size,contentType"
}
}

Getting a Specific Attachment

Retrieve details and content of a specific attachment:

Node Configuration:

{
"integration_service": "outlook",
"resource": "attachment",
"operation": "get",
"parameters": {
"messageId": "AAMkAGVmMDEzMTM4LTZmYWUtNDdkNC1hMDZiLTU1OGY5OTZhYmY4OABGAAAAAAAiQ8W967B7TKBjgx9rVEURBwAiIsqMbYjsT5e-T7KzowPTAAAAAAEMAAAiIsqMbYjsT5e-T7KzowPTAAAYbvZuAAA=",
"attachmentId": "AAMkAGVmMDEzMTM4LTZmYWUtNDdkNC1hMDZiLTU1OGY5OTZhYmY4OABGAAAAAAAiQ8W967B7TKBjgx9rVEURBwAiIsqMbYjsT5e-T7KzowPTAAAAAAEMAAAiIsqMbYjsT5e-T7KzowPTAAAYbvZuAAA=",
"select": "id,name,contentType,size,contentBytes"
}
}

Processing Attachments in Workflows

Use template variables to process attachment information:

Input Data from Previous Node:

{
"incident": {
"id": "INC-2024-001",
"severity": "critical",
"messageId": "AAMkAGVmMDEzMTM4LTZmYWUtNDdkNC1hMDZiLTU1OGY5OTZhYmY4OABGAAAAAAAiQ8W967B7TKBjgx9rVEURBwAiIsqMbYjsT5e-T7KzowPTAAAAAAEMAAAiIsqMbYjsT5e-T7KzowPTAAAYbvZuAAA="
}
}

Node Configuration with Template Variables:

{
"integration_service": "outlook",
"resource": "attachment",
"operation": "list",
"parameters": {
"messageId": "{{incident.messageId}}",
"filter": "size gt 1024 and (contentType eq 'application/pdf' or contentType eq 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet')",
"select": "id,name,contentType,size",
"top": 5
}
}

Integration in Workflow Context

The Outlook integration is particularly powerful when combined with other nodes in a workflow:

Complete workflow showing Outlook integration nodes connected with other node types

Common Workflow Patterns:

  1. Security Alert Notifications:

    • Security Scan Node → Script Node (analyze results) → If/Else Node (severity check) → Outlook Integration Node (send email alert)
  2. Scheduled Reporting:

    • Schedule Node → Script Node (generate report) → Outlook Integration Node (send email with attachment)
  3. Email Processing Pipeline:

    • Webhook Node (trigger) → Outlook Integration Node (get emails) → Script Node (analyze content) → Outlook Integration Node (send responses)
  4. Incident Response Coordination:

    • Alert Node → Script Node (incident details) → Outlook Integration Node (create calendar event) → Outlook Integration Node (send email to team)
  5. Contact Synchronization:

    • Database Node → Script Node (format contacts) → Outlook Integration Node (create/update contacts)

Troubleshooting OAuth2 Authentication

IssueResolution
Token expiredThe integration automatically refreshes tokens when possible. If this fails, reconnect the credential by clicking "Authorize" again.
Insufficient permissionsVerify that all required permissions are granted in Azure App Registration. You may need to re-consent to permissions.
Invalid client ID/secretDouble-check the client ID and client secret from Azure. Note that secrets expire and may need to be regenerated.
Redirect URI mismatchEnsure the redirect URI in Azure exactly matches the one expected by NINA.
Tenant restrictionsFor multi-tenant apps, ensure your Azure AD tenant allows the application access.
Connection issuesCheck network connectivity to Microsoft Graph API endpoints.
Consent issuesEnsure you're signing in with an account that has sufficient privileges to grant consent.
Request timeoutMicrosoft Graph API can have timeouts. Consider implementing retry logic in workflows.

Best Practices

  1. Use OAuth2 Properly: Keep client secrets secure and implement proper token refresh handling.

  2. Handle Attachments Carefully: Base64-encode file attachments correctly and set the appropriate content type.

  3. Leverage Template Variables: Use {{variable_name}} syntax to create dynamic, personalized email content.

  4. Filter Email Retrieval: When using "Get All Emails", always apply appropriate filters to limit the result set.

  5. Set Appropriate Timeouts: For operations involving large attachments or many recipients, allow for longer execution times.

  6. Error Handling: Implement error handling for rate limiting, authentication failures, and other API issues.

  7. Manage Credentials Carefully: Regularly rotate client secrets in Azure and update your credentials in NINA.

  8. Use Importance Flags Wisely: Reserve "high" importance for truly urgent messages to prevent recipient fatigue.

  9. Respect Calendar Availability: Check recipients' availability before scheduling calendar events.

  10. Process HTML Content Safely: When generating HTML email content, sanitize any user-provided input to prevent issues.