{"action":"closed","issue":{"url":"https://api.github.com/repos/structr/structr/issues/289","labels_url":"https://api.github.com/repos/structr/structr/issues/289/labels{/name}","comments_url":"https://api.github.com/repos/structr/structr/issues/289/comments","events_url":"https://api.github.com/repos/structr/structr/issues/289/events","html_url":"https://github.com/structr/structr/issues/289","id":47572516,"number":289,"title":"Receive error on registration action when user has onCreate method defined that sends mail","user":{"login":"eric-schleicher","id":8261783,"avatar_url":"https://avatars.githubusercontent.com/u/8261783?v=3","gravatar_id":"","url":"https://api.github.com/users/eric-schleicher","html_url":"https://github.com/eric-schleicher","followers_url":"https://api.github.com/users/eric-schleicher/followers","following_url":"https://api.github.com/users/eric-schleicher/following{/other_user}","gists_url":"https://api.github.com/users/eric-schleicher/gists{/gist_id}","starred_url":"https://api.github.com/users/eric-schleicher/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eric-schleicher/subscriptions","organizations_url":"https://api.github.com/users/eric-schleicher/orgs","repos_url":"https://api.github.com/users/eric-schleicher/repos","events_url":"https://api.github.com/users/eric-schleicher/events{/privacy}","received_events_url":"https://api.github.com/users/eric-schleicher/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2014-11-03T08:41:11Z","updated_at":"2015-11-02T19:56:42Z","closed_at":"2015-11-02T19:56:42Z","body":"Shouldn't make a difference here, but I've made eMail mandatory for the User Entity.\r\n\r\nPer Structr Team Guidance, \r\n\r\nCreated two Mail Templates:\r\n\r\nNEW_USER_WELCOME_SUBJECT\r\n```\r\nHi there ${this.eMail}\r\n```\r\nand\r\n\r\nNEW_USER_WELCOME_BODY\r\n```\r\nthanks for joining ${this.eMail}, please confirm your account\r\n\r\nhttp://vm-2/confirm_registration?key=${this.confirmationKey}&target=register_thanks&onerror=register_error\r\n```\r\nThe following is the the code for the onCreate method on User\r\n```\r\n(\r\nsend_plaintext_mail(\r\n \"welcome@example.com\", \r\n \"Example Team\", \r\n this.eMail, \r\n this.eMail, \r\n template(\"NEW_USER_WELCOME_SUBJECT\", \"en_US\", this), \r\ntemplate(\"NEW_USER_WELCOME_BODY\", \"en_US\", this)),\r\nset(this, \"visibleToAuthenticatedUsers\", \"true\")\r\n)\r\n```\r\n\r\nWhen using the CRUD interface to add data (user), emails are sent immediately (templating stings are also rendered/substituted correctly).  additionally, values manipulated in subsequent (to send email) clause(s) are evaluated correctly..  Deliveries are as expected.  \r\n\r\nHowever submission through registration page (constructed per security tutorial)\r\n```\r\n              <form action=\"javascript:void(0)\" role=\"form\" data-hash=\"abea525e\">\r\n                <fieldset data-hash=\"ce4b1bbe\">\r\n                  <div class=\"form-group\" data-hash=\"3bdf9ae4\">\r\n                    <input autofocus=\"\" name=\"eMail\" placeholder=\"your email address\" class=\"form-control\" data-structr-name=\"eMail\" data-hash=\"2382ccc0\">\r\n                  </div><!-- Change this to a button or input when using this as a form --><a href=\"javascript:void(0)\" class=\"btn btn-lg btn-success btn-block\" data-structr-action=\"registration\" data-structr-attributes=\"eMail\" data-structr-reload=\"false\" data-structr-return=\"index\" data-hash=\"f0f82463\">Sign Up</a>\r\n                </fieldset>\r\n              </form>\r\n```\r\nproduces the following error output\r\n\r\nlog output:\r\n```\r\norg.apache.commons.mail.EmailException: Invalid message supplied\r\n        at org.apache.commons.mail.SimpleEmail.setMsg(SimpleEmail.java:47)\r\n        at org.structr.common.MailHelper.sendSimpleMail(MailHelper.java:73)\r\n        at org.structr.core.parser.Functions$72.apply(Functions.java:2477)\r\n        at org.structr.core.parser.FunctionExpression.evaluate(FunctionExpression.java:57)\r\n        at org.structr.core.parser.GroupExpression.evaluate(GroupExpression.java:39)\r\n        at org.structr.core.parser.RootExpression.evaluate(RootExpression.java:36)\r\n        at org.structr.core.parser.Functions.evaluate(Functions.java:293)\r\n        at org.structr.schema.SchemaHelper.replaceVariables(SchemaHelper.java:812)\r\n        at org.structr.core.entity.AbstractNode.replaceVariables(AbstractNode.java:1072)\r\n        at org.structr.schema.action.Actions.execute(Actions.java:67)\r\n        at org.structr.dynamic.User.onCreation(User.java:54)\r\n        at org.structr.core.graph.GraphObjectModificationState.doInnerCallback(GraphObjectModificationState.java:227)\r\n        at org.structr.core.graph.ModificationQueue.doInnerCallbacks(ModificationQueue.java:80)\r\n        at org.structr.core.graph.TransactionCommand.commitTx(TransactionCommand.java:95)\r\n        at org.structr.core.graph.Tx.success(Tx.java:68)\r\n        at org.structr.rest.servlet.JsonRestServlet.doPost(JsonRestServlet.java:753)\r\n        at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)\r\n        at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)\r\n        at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:738)\r\n        at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1651)\r\n        at ch.qos.logback.access.servlet.TeeFilter.doFilter(TeeFilter.java:55)\r\n        at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1622)\r\n        at org.eclipse.jetty.servlets.UserAgentFilter.doFilter(UserAgentFilter.java:83)\r\n        at org.eclipse.jetty.servlets.GzipFilter.doFilter(GzipFilter.java:351)\r\n        at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1622)\r\n        at org.tuckey.web.filters.urlrewrite.RuleChain.handleRewrite(RuleChain.java:176)\r\n        at org.tuckey.web.filters.urlrewrite.RuleChain.doRules(RuleChain.java:145)\r\n        at org.tuckey.web.filters.urlrewrite.UrlRewriter.processRequest(UrlRewriter.java:92)\r\n        at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:389)\r\n        at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1622)\r\n        at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:549)\r\n        at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)\r\n        at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:568)\r\n        at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:221)\r\n        at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1111)\r\n        at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:478)\r\n        at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:183)\r\n        at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1045)\r\n        at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)\r\n        at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:199)\r\n        at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:109)\r\n        at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)\r\n        at org.eclipse.jetty.server.Server.handle(Server.java:462)\r\n        at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:279)\r\n        at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:232)\r\n        at org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:534)\r\n        at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:607)\r\n        at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:536)\r\n        at java.lang.Thread.run(Thread.java:745)\r\n```\r\n\r\nguidance appreciated"}}