cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

SAP Analytics Cloud Optimized Story Experience API Reference Guide

DomiK
Explorer
0 Likes
640

I have the following problem: I want to get a notification in my story both in the SAC and by mail when I click on a button (function onclick() ).

Here is my code:

 

var user_info = Application.getUserInfo();
console.log(user_info);
 
console.log("Senden beginnen:");
Application.sendNotification({
    "title": "Test",
    "content": "Test2",
    "receivers": [Application.getUserInfo().id],
    "isSendEmail": false
 
}
);
console.log("Senden beendet:");
 
I also have the appropriate authorizations (Runtime notification). Unfortunately, I still don't get a notification and the following exception is thrown in the JS code.
DomiK_0-1753085634274.png

KR

Dominik 

 

 
 

Accepted Solutions (0)

Answers (1)

Answers (1)

Lothar_Koeder
Active Participant

Hello @DomiK,

Your code has too much double quotes. Additionally with a isSendMail: false you'll never receive an e-mail. The following code works fine for me and I receive an e-mail:

var user = Application.getUserInfo().id;
Application.sendNotification(
	{
		title: "Test",
		content: "This is a journey into test",
		isSendEmail: true,
		mode: ApplicationMode.Present,
		receivers: [user]
	}
);

Best regards

Lothar

DomiK
Explorer
0 Likes
@ Lothar_Koeder Thank you for your response. Do we need to configure a user-specific mail-server to receive mails in the administration-page? And is it related to the fact that if no mail server is configured, no notification appears in the SAC (at the top of the menu by the bell)?
Lothar_Koeder
Active Participant
0 Likes
Hello @DomiK, yes. To use this API outside of scheduling you need to have a custom mail server in SAC. See SAP-help: https://help.sap.com/docs/SAP_ANALYTICS_CLOUD/00f68c2e08b941f081002fd3691d86a7/5e8acb2ae6004248ad3c0...