Any way to call ScriptHelper API for sending email

Use this forum for all questions related to the source code of OpenEMM

Moderator: moderator

Posts: 3
Joined: Wed Sep 05, 2012 11:38 am

Any way to call ScriptHelper API for sending email

Post by rastogi_mohit2005 » Wed Sep 05, 2012 12:52 pm


I am trying to send email using "Script Action". I have created as action of type "Script Action" and script text field as

Code: Select all

#set($result=$ScriptHelper.sendEmail($requestParameters.SENDER, $requestParameters.RECIPIENT, $requestParameters.SUBJECT, $requestParameters.TEXT, "", 0, "ISO-8859-1"))#if($result)#set($scriptResult="1")$ScriptHelper.println("Mail with subject $requestParameters.SUBJECT was sent to $requestParameters.RECIPIENT")#else#set($scriptResult="0")$ScriptHelper.println("Mail with subject $requestParameters.SUBJECT could NOT be sent to $requestParameters.RECIPIENT")#end#set($scriptResult="1") 
Now created a from with name "SendMail" and browing the link

Code: Select all

I can send email to single recipients with the above approach. But I have few queries

Query 1 : sendMail Script Action functionality is part of ScriptHelper class. Is there any way to call this API from web services. I mean any "Script Action" way to send email without hitting the URL in browser to single recipients.
Query 2 : Is there any way to provide Email text apart from the URL (e.g. TEXT=Hi)

Any help will be really helpful.