<cmsu:simpleMail> with template doesn't work !
----------------------------------------------
Key: MAGNOLIA-2502
URL: http://jira.magnolia-cms.com/browse/MAGNOLIA-2502
Project: Magnolia
Issue Type: Bug
Components: mail
Affects Versions: 3.6.1
Environment: Linux Ubuntu - Apache Tomcat 5.5.25
Reporter: Julie
Assignee: Boris Kraft
Attachments: JCR.jpg
Hi all !
I have a problem to send an email
I use the tags <cmsu:simpleMail> like this :
<cmsu:simpleMail to="email1" from="email2" subject="salut"
nodeCollectionName="contentParagraph" />
It works but no with an template specification (the email is not send) :
<cmsu:simpleMail to="email1" from="email2" subject="salut" template="essai"
nodeCollectionName="contentParagraph" />
I remind my config :
- in config > mail > templates > essai
* body = essai.html
* type = freemarker
- my essai.html is in the lib magnolia_mail (with testFreemaker.html,
testVelocity.html, ...)
- my form is on the page Contact.html (form paragraphes makes with samples
magnolia form)
<form name="formContact"
action="${pageContext.request.contextPath}${cmsfn:currentPage().handle}.html"
method="post" onsubmit="return VerificationFormulaire(this)">
<cms:contentNodeIterator
contentNodeCollectionName="mainColumnParagraphs">
<cms:includeTemplate />
</cms:contentNodeIterator>
</form>
in the same page; i have :
<cms:setNode var="pageProperties" />
<c:if test="${!empty(param.sendmail)}">
<cmsu:simpleMail to="${pageProperties.to}"
from="${pageProperties.from}" cc="${pageProperties.cc}"
bcc="${pageProperties.cc}" replyTo="${pageProperties.replyTo}"
logging="${pageProperties.trackMail}" subject="${pageProperties.subject}"
nodeCollectionName="mainColumnParagraphs" template="essai" />
</c:if>
My form (code generated) is this following :
<form name="formContact" action="/magnoliaAuthor/CCPB68/Contact.html"
method="post" onsubmit="return VerificationFormulaire(this)">
<input name="sendmail" value="true" type="hidden">
<input name="formName" value="contactForm" id="formName"
type="hidden">
<table width="90%" border="0">
<tbody>
<tr>
<td class="text" width="150" align="right">Vous
êtes : </td>
<td class="text" align="left">
<select name="dest" class="select"
onchange="changeSelect()">
<option
value="SALARIE">Salarié</option>
<option value="EMPLOYEUR">Employeur</option>
</select>
</td>
</tr>
<tr style="visibility: visible;"
id="salarie1"><td class="text" align="right">Nom et Prenom</td><td class="text"
align="left"><input class="input" size="30" name="field_0"
type="text"></td></tr>
<tr style="visibility: hidden;"
id="employeur1"><td class="text" align="right">Raison sociale :</td><td
class="text" align="left"><input class="input" size="30" name="field_03"
type="text"></td></tr>
<tr style="visibility: visible;"
id="salarie2"><td class="text" align="right">Numéro de dossier</td><td
class="text" align="left"><input class="input" size="30" name="field_01"
type="text"></td></tr>
<tr style="visibility: hidden;"
id="employeur2"><td class="text" align="right">Numéro d'adhérent</td><td
class="text" align="left"><input class="input" size="30" name="field_04"
type="text"></td></tr>
<tr style="visibility: visible;"
id="salarie3"><td class="text" align="right">Numéro de sécurité sociale</td><td
class="text" align="left"><input class="input" size="30" name="field_02"
type="text"></td></tr>
<tr style="visibility: hidden;"
id="employeur3"><td class="text" align="right">Numéro SIRET</td><td
class="text" align="left"><input class="input" size="30" name="field_05"
type="text"></td></tr>
<tr><td class="text"
align="right">Votre e-mail</td><td class="text" align="left"><input id="email"
class="input" size="30" name="field_06" type="text"></td></tr>
<tr><td colspan="2" class="text"
align="center">Adresse <br><textarea class="select" name="field_07" cols="55"
rows="4"> </textarea></td></tr>
<tr><td colspan="2" class="text"
align="center">Question<br><textarea class="select" name="field_08" cols="55"
rows="4"> </textarea></td></tr>
<tr><td colspan="2" class="text"
align="center"><br><br><div align="center"><input value="Envoyer"
name="validation" class="button" type="submit" align="center"></div></td></tr>
</tbody>
</table>
</form>
How to access the data form in the post ?
I try many many solution without success :
{field_0}
{0}
${field_0[0]}
${some_other_node.0} ****
${some_other_node.0.title} ****
${RequestParameters['field_0']}
${RequestParameters.field_0}
${Request['field_0']}
${Request.field_0}
${RequestParameters['f0']}
${RequestParameters.0}
${Request['0']}
${Request.0}
nothing works ! nothing !
I have these errors :
- for ****
ERROR info.magnolia.cms.taglibs.util.SimpleMailTag
SimpleMailTag.java(doEndTag:306) 09.12.2008 09:27:23 Encountered "0" at line
1, column 23.
Was expecting one of:
"false" ...
"true" ...
<LESS_THAN> ...
<LESS_THAN_EQUALS> ...
<ESCAPED_GT> ...
<ESCAPED_GTE> ...
"*" ...
"**" ...
"in" ...
"as" ...
"using" ...
<ID> ...
freemarker.core.ParseException: Encountered "0" at line 1, column 23.
Was expecting one of:
"false" ...
"true" ...
<LESS_THAN> ...
<LESS_THAN_EQUALS> ...
<ESCAPED_GT> ...
<ESCAPED_GTE> ...
"*" ...
"**" ...
"in" ...
"as" ...
"using" ...
<ID> ...
at freemarker.core.FMParser.generateParseException(FMParser.java:5244)
at freemarker.core.FMParser.jj_consume_token(FMParser.java:5119)
at freemarker.core.FMParser.DotVariable(FMParser.java:855)
at freemarker.core.FMParser.AddSubExpression(FMParser.java:717)
for other i have errors like this :
ERROR info.magnolia.cms.taglibs.util.SimpleMailTag
SimpleMailTag.java(doEndTag:306) 08.12.2008 10:10:57 Error on line 1, column 7
in essai.html
Expecting a string, date or number here, Expression field_0 is instead a
freemarker.template.SimpleSequence
Error on line 1, column 7 in essai.html
Expecting a string, date or number here, Expression field_0 is instead a
freemarker.template.SimpleSequence
The problematic instruction:
----------
==> ${field_0} [on line 1, column 5 in essai.html]
----------
Java backtrace for programmers:
----------
freemarker.core.NonStringException: Error on line 1, column 7 in essai.html
Expecting a string, date or number here, Expression field_0 is instead a
freemarker.template.SimpleSequence
at freemarker.core.Expression.getStringValue(Expression.java:126)
at freemarker.core.Expression.getStringValue(Expression.java:93)
at freemarker.core.DollarVariable.accept(DollarVariable.java:76)
and finally if email.html is <h1>Hello</h1> it doesn't work anymore !!!!!!
ERROR info.magnolia.cms.taglibs.util.SimpleMailTag
SimpleMailTag.java(doEndTag:306) 08.12.2008 16:08:11
java.lang.NullPointerException
at
info.magnolia.cms.mail.MgnlMailFactory.getEmailFromTemplate(MgnlMailFactory.java:207)
at
info.magnolia.cms.taglibs.util.SimpleMailTag.doEndTag(SimpleMailTag.java:294)
at
org.apache.jsp.templates.CCPB68.templates.tp_005fcontact_jsp._jspx_meth_cmsu_005fsimpleMail_005f0(tp_005fcontact_jsp.java:350)
at
org.apache.jsp.templates.CCPB68.templates.tp_005fcontact_jsp._jspx_meth_c_005fif_005f0(tp_005fcontact_jsp.java:318)
at
org.apache.jsp.templates.CCPB68.templates.tp_005fcontact_jsp._jspService(tp_005fcontact_jsp.java:130)
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.magnolia-cms.com/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
----------------------------------------------------------------
For list details see
http://www.magnolia-cms.com/home/community/mailing-lists.html
To unsubscribe, E-mail to: <[EMAIL PROTECTED]>
----------------------------------------------------------------