Page 1 of 1

Any way to call ScriptHelper API for sending email

Posted: Wed Sep 05, 2012 12:52 pm
by rastogi_mohit2005
Hi,

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

http://localhost:8080/form.do?agnCI=1&agnFN=SendMail&SENDER=rastogi_mohit2005@yahoo.co.in&RECIPIENT=mohit.rastogi0428@gmail.com&SUBJECT=Testing%20OpenEMM&TEXT=Hi 
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.

Thanks,
Mohit