[MGNLMAIL-47] MailTemplate configured parameters replaced by context parameters Created: 12/Oct/09 Updated: 16/Jan/15 Resolved: 02/Jan/15 |
|
| Status: | Closed |
| Project: | Magnolia Mail Module |
| Component/s: | Backend, Templates |
| Affects Version/s: | None |
| Fix Version/s: | 5.1.4, 5.2.2 |
| Type: | Bug | Priority: | Major |
| Reporter: | Marco Collovati | Assignee: | Robert Šiška |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Attachments: |
|
| Template: |
|
| Patch included: |
Yes
|
| Acceptance criteria: |
Empty
|
| Task DoD: |
[ ]*
Doc/release notes changes? Comment present?
[ ]*
Downstream builds green?
[ ]*
Solution information and context easily available?
[ ]*
Tests
[ ]*
FixVersion filled and not yet released
[ ] 
Architecture Decision Record (ADR)
|
| Bug DoR: |
[ ]*
Steps to reproduce, expected, and actual results filled
[ ]*
Affected version filled
|
| Description |
|
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. To reproduce
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 |