SAP Knowledge Base Article - Public

3479149 - SAC - Email is not being sent from SAC script API

Symptom

The user is attempting to send an email using SAC script code. Although the SAC script indicates that the email was sent successfully, the recipients do not receive the email.

Environment

SAP ANALYTICS CLOUD

Reproducing the Issue

  1. Schedule the story/Analytic application
  2. Add the code below into Onclick button:

if(Scheduling.isRunBySchedulePublication()){
var receivers = ArrayUtils.create(Type.string);
receivers.push(Application.getUserInfo().id); 
receivers.push('UserEmail'); 

var content = 'Test message from code';

        var emailSent = Application.sendNotification({
                'content':content,
                'title':'Test message from code',
                'isSendEmail':true,
                'receivers':receivers
        });

if(emailSent){
    Text_3.applyText('Email send successfully');
}else{
    Text_3.applyText('Email trigger failed');
}

Scheduling.publish();
}

-> The email from schedule should send out successfully with PDF attachment but no Email sent

Cause

Product limitation

Resolution

Email notifications can only be sent to SAC users using their SAC IDs. This behavior is by design.

See Also

Keywords

SAP Cloud for Planning, sc4p, c4p, cforp, cloudforplanning, Cloud for Analytics, Cloud4Analytics, CloudforAnalytics, Cloud 4 Planning, Email Notification, API, sendNotification, SAC IDs.
 
, KBA , LOD-ANA-AD , Analytics Designer , Problem

Product

SAP Analytics Cloud all versions