How to pass Email Text using Script Action

Use this forum for questions regarding adoption and functionality of OpenEMM

Moderator: moderator

How to pass Email Text using Script Action

Postby rastogi_mohit2005 » Wed Sep 05, 2012 12:46 pm

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
rastogi_mohit2005
 
Posts: 3
Joined: Wed Sep 05, 2012 11:38 am

Return to Using OpenEMM

Who is online

Users browsing this forum: No registered users and 4 guests

cron