TK

Why Use This Method?

In ARIS Cloud, the default mail server is often predefined. However, you may want to connect to an external mail server for various reasons:

  • Security compliance (e.g., using a centralized corporate mail server)
  • Custom email handling and integration with other systems
  • Flexibility in choosing your mail service provider

The following script will allow you to bypass the internal mail server by connecting to Microsoft Graph API directly.

Requirements

To implement this script, you'll need the following:

  1. Microsoft Azure App Registration: Create an app and register it in Azure AD to get your OAuth credentials.
  2. Microsoft Graph API Permissions: Grant appropriate permissions to your Azure app to send emails.
  3. ARIS Scripting Environment: We are using JavaScript (Rhino) in ARIS to perform the authentication and API call.

Script Overview

Here is a JavaScript code that can be embedded in ARIS to send emails using Microsoft Graph

  • see Attachment

 

Explanation of the Code

  1. Obtain Access Token (OAuth2): The script first requests an OAuth2 access token from Microsoft Identity Platform using the client_credentials grant type. The access token is then used to authenticate subsequent requests to the Microsoft Graph API.
  2. Sending the Email: Once we have the access token, the script constructs an email object and sends it via the Microsoft Graph sendMail API. The API accepts a JSON payload containing the email's subject, body, recipient, and other details.
  3. Using Rhino: ARIS uses Rhino (a JavaScript engine for Java) for scripting, so we leverage Java's networking libraries to make HTTP requests.

How to Implement This in ARIS

  1. Open your ARIS Script Editor.
  2. Copy the script into your ARIS environment.
  3. Replace the placeholder values (client ID, secret, email addresses, etc.) with your actual details.
  4. Execute the script to send an email.

Conclusion

This method offers an alternative to using the built-in mail server of ARIS Cloud, providing flexibility for email delivery. With the OAuth2 and Microsoft Graph setup, you gain full control over your email service while maintaining security and compliance.

If you encounter any issues or have questions, feel free to leave a comment below!

File attachments

Featured achievement

Explorer
Take a tour! Learn more about the different ARIS Community areas and ARIS editions.
Recent Unlocks
  • SN
  • DB
  • AI
  • VC
  • SA
  • PacMan

Leaderboard

|
icon-arrow-down icon-arrow-cerulean-left icon-arrow-cerulean-right icon-arrow-down icon-arrow-left icon-arrow-right icon-arrow icon-back icon-close icon-comments icon-correct-answer icon-tick icon-download icon-facebook icon-flag icon-google-plus icon-hamburger icon-in icon-info icon-instagram icon-login-true icon-login icon-mail-notification icon-mail icon-mortarboard icon-newsletter icon-notification icon-pinterest icon-plus icon-rss icon-search icon-share icon-shield icon-snapchat icon-star icon-tutorials icon-twitter icon-universities icon-videos icon-views icon-whatsapp icon-xing icon-youtube icon-jobs icon-heart icon-heart2 aris-express bpm-glossary help-intro help-design Process_Mining_Icon help-publishing help-administration help-dashboarding help-archive help-risk icon-knowledge icon-question icon-events icon-message icon-more icon-pencil forum-icon icon-lock