cancel
Showing results for 
Search instead for 
Did you mean: 

How to send mails with Application.sendNotification() // Notification API

Hi there,

I am currently trying to figure out how to send mails using the Notification API. Somehow it seems that nothing is triggered (the function is embedded in the canvas onInitialization() function. I guess the issue is the receivers object).

How is the `receivers` `users` logic basically? We tried hard coded mail-adresses as str in "receivers" as well as an empty receiver list to use the default which according to the docu is the current user. We never received an e-mail.

The official docu sends a mail to "Jack", but what would Jack looks like in our organisation?

// Get current user_object

var user_info = Application.getUserInfo();

// Print current user_object

console.log(user_info); 

// Prints: {id: "JONAS", displayName: "Jonas"}

// Send mail to user, issue raised: https://answers.sap.com/questions/13093398/how-to-send-mails-with-applicationsendnotification.html

Application.sendNotification({

 "title": "Test Title",

 "content": "Test Content",

 "receivers": ["JONAS"],

 "mode": ApplicationMode.Present,

 "isSendEmail": true

});

// Show success message

Info_Popup.open();

jerryjanda
Community Manager
Community Manager
0 Kudos

Hi, Jonas:

Thank you for visiting SAP Community to get answers to your questions. Since you're asking a question here for the first time, I recommend that you familiarize yourself with https://community.sap.com/resources/questions-and-answers (if you haven't already), as it provides tips for preparing questions that draw responses from our members.

Should you wish, you can revise your question by selecting Actions, then Edit (although once someone answers your question, you'll lose the ability to edit the question -- but if that happens, you can leave more details in a comment).

Finally, if you're hoping to connect with readers, please consider adding a picture to your profile. Here's how you do it: https://www.youtube.com/watch?v=F5JdUbyjfMA&list=PLpQebylHrdh5s3gwy-h6RtymfDpoz3vDS. By personalizing your profile with a photo of you, you encourage readers to respond.

Kind regards,

--Jerry

petrisnovak
Explorer
0 Kudos

Hello,

I can confirm this behaviour. I have never received an email from this function. Any attempt returns "false" when you print the function result to the console for example.

Please fix this :(.

Thank you,

Petr Novak

chr_br
Explorer
0 Kudos

Hi Jonas,

did you get it to work? I'm running into the same error and not receiving any emails. The check mark in the user settings is set to receive system notifications, but no mail arrives. Also, our cloud location matches the ones mentioned below.

Regards

Christian

0 Kudos

Hi Christian,

unfortunately not. My SAP colleagues internally told me that we do not have this feature in our tenant license structure. As far as I understood it as an average Joe, there needs to be some further backend setup implemented in order to send mails via SAC. Maybe reach out to your IT guys to further discuss. Maybe they will have to consult SAP or the docu.

Good Luck.

Kind regards,

Jonas

Accepted Solutions (0)

Answers (3)

Answers (3)

0 Kudos

Hi,

I think Afshin Irani is right, this feature is only enable for Cloud Foundry and not NEO.

Also from the help doc: https://help.sap.com/docs/SAP_ANALYTICS_CLOUD/00f68c2e08b941f081002fd3691d86a7/5e8acb2ae6004248ad3c0...

Notifications are only triggered when the analytic application is running via scheduling for publication. If you want to send notifications without scheduling, on the fly in the runtime, ensure that your own mail server’s been configured.

thanks,

Jason

0 Kudos

Hi,

I think Afshin Irani is right, this feature is only enable for Cloud Foundry and not NEO.

Also from the help doc: https://help.sap.com/docs/SAP_ANALYTICS_CLOUD/b103a251020746f786ec0860fa51a63a/5e8acb2ae6004248ad3c0...

Notifications are only triggered when the analytic application is running via scheduling for publication. If you want to send notifications without scheduling, on the fly in the runtime, ensure that your own mail server’s been configured.

thanks,

Jason

former_member6443
Contributor
0 Kudos

Hi Jonas & Petr,

As I understand this feature is only enable for Cloud Foundry and not NEO Clients.

This is based on the fact that Schedule & Publications is available on Cloud Foundry.

Again I have the right to be wrong here 🙂

Schedule publications are available in tenants which are provisioned on top of the SAP Cloud Platform Cloud Foundry environment. The list is as below:

  • AWS Europe Central (EU10)
  • AWS US East (US10)
  • AWS Brazil (BR10)
  • AWS Japan (JP10)
  • AWS Sydney (AP10)
  • AWS Singapore (AP11)
  • Ali cloud China (CN40)

Regards

Afshin