Problem with creating action
Posted: Tue Feb 03, 2015 12:22 am
Hi,
I have installed OpenEMM 2015RC2 on a fresh install of Centos 7. Most things seem to be working but I was trying to create a new form and action that would allow for an unsubscribe multi link in an email. I used the older directions at the following link...
https://forum.openemm.org/ftopic619.html
but when I copy and paste the following code into a new action and save it...
##unsubscribe script for more mailinglists
##set Company ID
#set($company = 1)
##Check the availability of the customer
#if($customerID != 0)
$BindingEntry.setCustomerID($customerID)
##define first mailinglist
$BindingEntry.setMailinglistID(1)
#if($BindingEntry.getUserBindingFromDB($company) == true)
#if($BindingEntry.getUserStatus() == 1)
$BindingEntry.setUserStatus(3)
$BindingEntry.setUserRemark("Opt-Out by Script")
$BindingEntry.updateBindingInDB($company)
#set($result="checked out from list A")
#else
#set($result="not active on list A")
#end
#else
#set($result="without binding to list A")
#end
##define second mailinglist
$BindingEntry.setMailinglistID(2)
#if($BindingEntry.getUserBindingFromDB($company) == true)
#if($BindingEntry.getUserStatus() == 1)
$BindingEntry.setUserStatus(3)
$BindingEntry.setUserRemark("Opt-Out by Script")
$BindingEntry.updateBindingInDB($company)
#set($result1="checked out from list B")
#else
#set($result1="not active on list B")
#end
#else
#set($result1="without binding to list B")
#end
#else
#set($result="not a customer of our mailings")
#set($result1="not a customer of our mailings")
#end
##necessary for a successful result
#set($scriptResult="1")
I get an error when trying to save that says " A general error occurred. Please check your input."
Any help would be greatly appreciated.
Thanks
Mike
I have installed OpenEMM 2015RC2 on a fresh install of Centos 7. Most things seem to be working but I was trying to create a new form and action that would allow for an unsubscribe multi link in an email. I used the older directions at the following link...
https://forum.openemm.org/ftopic619.html
but when I copy and paste the following code into a new action and save it...
##unsubscribe script for more mailinglists
##set Company ID
#set($company = 1)
##Check the availability of the customer
#if($customerID != 0)
$BindingEntry.setCustomerID($customerID)
##define first mailinglist
$BindingEntry.setMailinglistID(1)
#if($BindingEntry.getUserBindingFromDB($company) == true)
#if($BindingEntry.getUserStatus() == 1)
$BindingEntry.setUserStatus(3)
$BindingEntry.setUserRemark("Opt-Out by Script")
$BindingEntry.updateBindingInDB($company)
#set($result="checked out from list A")
#else
#set($result="not active on list A")
#end
#else
#set($result="without binding to list A")
#end
##define second mailinglist
$BindingEntry.setMailinglistID(2)
#if($BindingEntry.getUserBindingFromDB($company) == true)
#if($BindingEntry.getUserStatus() == 1)
$BindingEntry.setUserStatus(3)
$BindingEntry.setUserRemark("Opt-Out by Script")
$BindingEntry.updateBindingInDB($company)
#set($result1="checked out from list B")
#else
#set($result1="not active on list B")
#end
#else
#set($result1="without binding to list B")
#end
#else
#set($result="not a customer of our mailings")
#set($result1="not a customer of our mailings")
#end
##necessary for a successful result
#set($scriptResult="1")
I get an error when trying to save that says " A general error occurred. Please check your input."
Any help would be greatly appreciated.
Thanks
Mike