Product Lifecycle Management Blog Posts by Members
cancel
Showing results for 
Search instead for 
Did you mean: 
egeAksoyek
Explorer
651

Introduction

In SAP DM, email notifications can be sent to one or multiple users using the Create & Update Alert Services. To do this, it is sufficient to provide our data to the AlertNotification field, apart from 'IN_APP'. With a recent update to DM, our existing mail destination was automatically brought into the Destinations section inside our BTP account.

When creating custom emails, this destination can be utilized via the Cloud SDK. The reason for leveraging the Cloud SDK for sending custom emails is that the styles and content of emails sent through alert services within DM cannot be customized. If there is a need to send information beyond the fixed email text, an alternative method outside of alert services is required.

Sending Mails with Create Alert Service

In standard DM developments, when using the Create Alert service, we can send the alert to the specified email by setting the ActionType value to SAP_MAIL in the AlertNotification body parameter.

["Figure 1- Alert Notification Body Parameter"]["Figure 1- Alert Notification Body Parameter"]

Additionally, to utilize the mail service, it is necessary to verify that a destination of type 'Mail' is configured in the 'Destinations' section of SAP BTP.

["Figure 2- Destination Configuration of the Mail Server"]["Figure 2- Destination Configuration of the Mail Server"]

Once the necessary connections are established and the Create Alert service is triggered with the provided parameters, the email notification is received as shown below.["Figure 3-Example Alert Mail"]["Figure 3-Example Alert Mail"]

However, as can be seen, these template email notifications offer limited capabilities in terms of both content and scenario diversity. 

This blog will provide examples of integrating a custom email service into DM as a third party using the mail client feature in Cloud SDK, and utilizing the existing MAIL destination for our processes.

["Figure 4- Basic Send Mail Service"]["Figure 4- Basic Send Mail Service"]

 ["Figure 5- Receiced Basic Mail"]["Figure 5- Receiced Basic Mail"]

In addition to the simple email shown in the image, the main additional features that can be added and used are as follows: cc, replyTo, html (the message to be sent can be designed and shared in HTML format), attachments, and priority.

 

 

 

 

["Figure 6- Mail Attachment Examples"]["Figure 6- Mail Attachment Examples"]

Images can be embedded within the page, and they can also be sent as attachments. The key point here is that the name of the image used must match the provided CID correctly.

 

 

 

["Figure 7- Received Mail with Attachments and Images"]["Figure 7- Received Mail with Attachments and Images"]

Usage of the Mail Service as a Third Party in DM Processes

By triggering our service via Postman, we are now ready to integrate it as a third party within DM for future process designs. To achieve this, we navigate to 'Manage Service Registry' in DM and create a new service under 'API Services,' assigning our defined path to the URL path.

After configuring our method and defining the request and response structures, we save the service and proceed to 'Design Production Process' for testing.

["Figure 8- Service API Template of Mail Service"]["Figure 8- Service API Template of Mail Service"]

 

 

After opening our design, we navigate to 'Services and Process' and select our mail service from the group where it was added under 'Select Services.' Once selected, we save the configuration. This setup allows us to tailor our setups and introduce variety to our developments based on customer requirements.

["Figure 9a- Custom Service Selection in Process Designer"]["Figure 9a- Custom Service Selection in Process Designer"]["Figure 9b- Basic Process Template with Third Party Service"]["Figure 9b- Basic Process Template with Third Party Service"]

Future Directions & Possibilities

"Examples of scenario customizations and the variety of responses to customer requests enabled by the added email service include:

  • Automatically sending data via email: Instead of downloading filtered tables from report pages as Excel files, the data can be automatically sent to predetermined or input-specified email accounts after being retrieved.
  • Sending critical information with CCs: Critical information can be sent to necessary groups, including CCs, to ensure the information reaches all relevant recipients.
  • Creating internal email handling pages: Developing pages within DM for internal email receipt and response, facilitating better internal communication.

If you like this post or have any questions, please let us know in the comments.
All questions are highly appreciated.

 Ege Aksöyek 

 

Reference Documents

Configure Email Notifications | SAP Help Portal