Technology Blogs by Members
Explore a vibrant mix of technical expertise, industry insights, and tech buzz in member blogs covering SAP products, technology, and events. Get in the mix!
cancel
Showing results for 
Search instead for 
Did you mean: 
FarooqAhmed
Participant
A few years ago one of the client team asked me can PI/PO able to send other than plain/text  EMAIL notifications for standard CBMA/MAIL receiver scenarios?.

The answer was YES, PI/PO can able to sent more organized and feel good mails which can present the required data in the tabular form or more colorful or more catchy. Have done it and showed how it was working.

Recently again the same question was asked by another client does CPI/CI able to send more attractive emails instead of plain and text emails?.

The answer is YES. Its not only Integration Suite(CI) but also the BTP Alert Notification Service can able to sent more fascinating emails. Just embed few lines of HTML tags in the actual MAIL BODY thats it!!! But remember don't use the unnecessary tags in order to "keep the core clean". Also the same email body can be explicitly set using groovy script but i personally do no suggest always relying on scripts when things can be done in standard way why to make the maintenance difficult.

It so happens if some ABAP or FIORI screens are been used by the client-user to get to know the capabilities of SAP. What if the end user is not really connected with the background processing of their enterprise data where SAP is leveraged at its BEST. Might be for one of the usual business case of notifying the User about the technical/functional error alerts or some important ORDERS receivable/processing by the middleware system or some other very critical bank interfaces processing updates. Whatso ever that notification email plays the extra cosmetic advantage of not only representing the calibrated tool efficacy but also the puzzling question what's running behind the screens for the new or non-sap users. In this AI-Gen world nothing goes waste even the word of mouth considered to be a unrealistic publicity.

Let us checkout some of the CI cases where this can be a promising approach of fine tuning the USP of the BTP as a product.

From Integration Suite(CI):

Case-1:

How can the emails be send in the tabular format with the required data passed dynamically from the specific interface to global exception interface?

If there is a global exception interface the below can be kept inside the MAIL receiver channel and for some scenarios where direct MAIL should be sent for some ORDER updates then that IFLOW actual MAIL receiver channel should be configured with the same as below


MAIL RECEIVER


The MAIL BODY should be as below.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>EMAIL</title>
<style>
table, th, td {
border: 1px solid black;
}
</style>
</head>
<body>
<p>Hi,<br><br>
Please find below details for Interface Message failure.<br>
<table>
<tr>
<td><span style="font-weight:bold">BTP-CI Environment</span></td>
<td>${header.CPIEnvironment}</td>
</tr>
<tr>
<td><span style="font-weight:bold">Message ID</span></td>
<td>${header.MessageId}</td>
</tr>
<tr>
<td><span style="font-weight:bold">SenderSystem</span></td>
<td>${header.SenderSystem}</td>
</tr>
<tr>
<td><span style="font-weight:bold">ReceiverSystem</span></td>
<td>${header.ReceiverSystem}</td>
</tr>
<tr>
<td><span style="font-weight:bold">Timestamp</span></td>
<td>${header.Timestamp}</td>
</tr>
<tr>
<td><span style="font-weight:bold">Error Message</span></td>
<td>${header.ErrorMessage}</td>
</tr>
</table><br>
Do Not Reply to this mail. Please contact SAP-Integration Team for further investigation.<br><br>
Regards,<br>
SAP Integration Team.
</p>
</body>
</html>

The BODY MIME Type should be "TEXT/HTML" instead of "TEXT/XML".

After execution the OUTLOOK or GMAIL or any other exchange server will be received the mail as below


EMAIL FORMAT


Case-2:

How can the emails be send in the tabular format with some colors embedded and main text highlighted in required color?

Modify the table style declaration and required row with span

<table style="background-color:LightGray;">

<td><span style="color: red;">Your Input Data</span></td>


Case-3:

How can the emails be differentiated based on the environments?

Well there was the time while using the SAP systems through GUI , consultants used to keep different screen colors for each environment. For example DEV: GREEN, QA: ORANGE and PROD: RED.

Similarly we can make a notifiable difference in the mails received from which environment its sent from. However there will be the subject or some row in the body indicating that environment specific information but if its added with some background color on top of normal text which will be very much helpful. As most of them will set the outlook=>layout=>folder pane=>normal where the mail body will be noticed immediately this can be achieved by using the below.

Modify the body tags as below

<body style="background-color:MediumSeaGreen;"> in DEV CI Interface Mail Channel
<body style="background-color:Orange;"> in QA CI Interface Mail Channel
<body style="background-color:Tomato;"> in PROD CI Interface Mail Channel

This can be useful when the mail recipient list is the same for all or any two CI environments.


From SAP BTP Alert Notification Service:

While configuring for the Alert Notification Service any type of alerts can be configured. Among all the available action types " EMAIL " and " EMAIL with Custom SMTP Server " can used for different subscription sources and accordingly the conditions can be configured.


Once the Action Type "EMAIL" is selected then the below options to be used to configure the email with the HTML embedded body

Use HTML checkbox to be selected.

Payload Template should be inserted with the required custom payload template.


Conclusion:

There are different types of HTML tables, styles, formatting, colors, symbols, emojis etc., which can be used as per the requirement and embed those lines of tags in the EMAIL BODY with dynamic and static values.

SAP always suggests to follow the standard so when this can be done using a simple html tags better to use the same tags using the dynamic properties directly in the EMAIL BODY and not relying on other groovy scripts as the maintenance will be difficult.

Also for S4 HANA or AIF any SAP products where the standard or custom alerts are possible just check for HTML support. If its present then similar configurations can be done over there and make the emails more fancy!!!

Disclaimer:

This article is only for informational purpose that usage of HTML tags inside the MAIL BODY gives more attractive EMAILS to the recipients.

Few cases are shown as an example but no limitations in any perspective.
3 Comments
Labels in this area