[ 
http://jira.magnolia-cms.com/browse/MAGNOLIA-2890?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Grégory Joseph updated MAGNOLIA-2890:
-------------------------------------

    Affects Version/s: 4.1.1
                           (was: 4.1.x)

> MailTemplate configured parameters replaced by context parameters
> -----------------------------------------------------------------
>
>                 Key: MAGNOLIA-2890
>                 URL: http://jira.magnolia-cms.com/browse/MAGNOLIA-2890
>             Project: Magnolia
>          Issue Type: Bug
>          Components: mail
>    Affects Versions: 4.1.1
>            Reporter: Marco Collovati
>            Assignee: Boris Kraft
>         Attachments: MgnlMailFactory.diff
>
>
> Maybe there is a bug in mail module working with parameters.
> If you define a template with some parameters in mail module configuration 
> and then you send an email replacing those parameters you lost the original 
> values until you reload mail module.
> The problem depends on the method getTemplate(String templateName) in 
> MgnlMailFactory; BeanUtils.cloneBean(...) creates a shallow clone of the 
> original MailTemplate object, so if we modify the parameters map in the 
> cloned bean we are effectively working on the original Map.
> I think the same happens with attachmentes
> To reproduce
> * Create simple freemarker template  {quote}Param1: $\{param1!'Not defined'}
> Param2: $\{param2!'Not defined'}
> Param3: $\{param3!'Not defined'}
> {quote}
> * Configure the template under /modules/mail/config/templatesConfiguration 
> {quote}
> myTemplate
>    - parameters
>        -- param1 => Param1
>        -- param2 => Param2
>        -- param3 => Param3
>    - from => ...
>    - subject => ...
>    - templateFile => path of the new template
>    - type => freemarker
> {quote}
> * Use Tools -> Mail to send a test email using the new template myTemplate, 
> without setting parameters
> * Send another mail setting the parameter param1 (param1=My test parameter)
> * Send another mail wihtout parameters
> The first and the second email are correct. In the third email param1 has 
> value "My test parameter" insted of "Param1"
> A simple patch is attached

-- 
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]>
----------------------------------------------------------------

Reply via email to