Skip to Content
0

How to send email from sap hana xs server using javascript

Jul 03, 2017 at 02:53 PM

739

avatar image

Hi All,

For my Thesis, i am developing an OData Service in HANA. Actually the Service is reporting Data from a set of Production lines. What i'm stuck with right now is how to send out alerts if expected figures within a time frame on a particular production line are not met.

So far i understand that it is not possible to send alerts from Hana Backend to Frontend(which will be a SAPUI5 App in my case). So what i intend to used is XSJS that will periodically compare actual figures with expected figures and if expected figures are not met, will send an email to the line Manager. But i just don't know how to generate emails with xsjs. This thread which appeared promising unfortunately leads to nowhere.

I will be very grateful if someone could guide me on how to accomplish this, or if there is another way at all of generating alerts/notifications from Hana Backend.

Thanks in advance

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Florian Pfeffer
Jul 03, 2017 at 07:39 PM
1

In XS Classic you can use the $.net.Mail API to send an email. Consider that the SMTP server settings have to be done (SMTP server configuration XS Classic).

But according to your description, you should think about the usage of the XS Advanced programming model. With that you can do your backend implementation for instance with Node.js and use the available web-socket modules. So you would be able to send the required notifications directly to your UI5 app.

Best Regards,
Florian

Show 2 Share
10 |10000 characters needed characters left characters exceeded

@Florian;

Thanks for your directions. unfortunately i have little experience with Node.js. I wouldn't know how to go about implementing this. Could you possibly outline how this would be implemented?

Thanks in advance

0

Question: Is XS Advanced available in your system environment? If yes then you could check the HANA Dev Guide for XS Advanced, which is available in the official online documentation of SAP.

0