Use State Model APIs to send Renewal Notifications
Use these APIs to send customer and internal notifications from the state model:
SEND EMAIL:
Signature:
sendEmail
(Long contractId, String toAddress, String ccAddress,
String bccAddress,String language, String subject, String messageTemplate,
String messageBody, String contractLayoutTemplate,String termsLayoutTemplate,
String attachmentName, String logInteraction
)
-
contractId: Id that represents the contract.
-
toAddress: it represents the email address to send notification.
-
ccAddress: it represents the email address to send notification as Cc.
-
bccAddress: it represents the email address to send notification as Bcc.
-
language: it represents message language in template sets rules.
-
subject: it represents email subject
-
messageTemplate: it represents message template name defined in notification rules.
-
messageBody: it represents email body.
-
contractLayoutTemplate: it represents contract layout template name defined in notification rules.
-
termsLayoutTemplate: it represents terms layout template name defined in notification rules.
-
attachmentName: it represents attachment name defined in notification rules.
-
logInteraction: To capture logs 'Y' (enable capturing) or 'N' (disable capturing).
Return Values:
Boolean - true if successfully email API is triggered or it returns false.
GET TEMPLATE:
This API is used to get the templates from Event Notification Rules.
Signature:
getTemplate(Long contractId,
String language, String event)
.
Parameters:
-
contractId: Id that represents the contract.
-
language: Represents the message language in template sets rules.
-
event: Represents event condition code.
Return Values:
-
String Array []:
-
0- ContractLayoutTemplate
-
1- TermsLayoutTemplate
-
2- MessageTemplate
-
3- AttachmentName
-
Example Code for SendEmail and GetTemplate:
Groovy Script:
String[] attTemplates = new String[4];
attTemplates=eventModel.applicationModule.getTemplate(ContractId,"US","ORA_SEND_QUOTE");
String toAddress="abc@oracle.com";
String ccAddress="xyz@oracle.com";
String bccAddress="def@oracle.com";
String language="US";
String subject="Test";
String messageTemplate=attTemplates[2];
String messageBody="MessageBody";
String contractLayoutTemplate=attTemplates[0];
String termsLayoutTemplate=attTemplates[1];
String attachmentName=attTemplates[3];
String logInteraction="Y";
boolean sri=eventModel.applicationModule.sendEmail(contractId, toAddress, ccAddress, bccAddress, language, subject, messageTemplate, messageBody, contract
NOTIFYREP:
Signature:
notifyRep(String messageSubject,
String messageText, List<String> toSet, String senderEmail)
.
Parameters:
-
messageSubject: Represents Email Subject.
-
messageText: Represents Email Body.
-
toSet: Represents set of email lists to send notification.
-
senderEmail: Represents the Sender Email.
Return Values:
Boolean - true if successfully email API is triggered or it returns false.
Example Code for
Notifyrep
:
List<String> s= new ArrayList<String>();
s.add('xyz@oracle.com');
boolean sri=
eventModel.applicationModule.notifyRep('Test','from message body',s,'srinivas.arram@oracle.com')