AnsweredAssumed Answered

sending an email via website

Question asked by idiotsguide on May 20, 2012
Latest reply on Sep 5, 2013 by michaelc
Hi everyone,

I have built a website around my alfresco system (4.0), using the quickstart as my base, but I'm working on a contact us form and having a problem. I have created a simple form in my contactus.get.html.ftl file, and i've created a contactus.post.js file. In here I want to email myself to notify me that someone has filled out the form. I've been looking around all the documentation, etc and came across this….

var mail = actions.create("mail");
mail.parameters.to = "me@me.com";
mail.parameters.subject = "Someone has used the contact us form";
mail.parameters.from = "website@thewebsite.com";
mail.parameters.text = "All good";
mail.execute();

Which I have been trying to get working but this is what I get when the script runs..
Failed to execute script 'org.springframework.extensions.webscripts.ResourceStore$WebApplicationStoreScriptContent@2080bcd8': 04200010 ReferenceError: "actions" is not defined.

Am I completely on the wrong track here? (Just when I thought I was getting my head around Alfresco!).
I'd be most grateful if anyone could help.

Thanks.

Outcomes