-
Improvement
-
Resolution: Unresolved
-
Neutral
-
None
-
None
-
-
Empty show more show less
-
Yes
-
Yes
To reproduce:
- create new form component
- add two textfields, one with the fieldname "type" and the other with the fieldname "contentType"
- add ${ type } and ${ contentType } to the email text in the form component dialog
- send the form
- in the mail text the values of those fields have been overwritten with "freemarker" and "html" or "text" depending on the mail type you configured
The problem lies in the method info.magnolia.module.mail.MgnlMailFactory#getEmailFromType
Map<String, Object> newParams = new HashMap<String, Object>(); newParams.putAll(params); if(!StringUtils.isEmpty(type)) { newParams.put(MailTemplate.MAIL_TYPE, type); } if(!StringUtils.isEmpty(contentType)) { newParams.put(MailTemplate.MAIL_CONTENT_TYPE, contentType); } return getEmail(newParams, attachments);
Here the parameters are overwritten, with the put() method.
The contentType param may not be that big of a problem, but recently one of our customers named one of its form fields "type" and was surprised to always get "freemarker" as value in the email text.
Improvement expectation:
Separate email built-in parameters with other params such as Form processor params so that customers won't have to mind about this issue.
Acceptance criteria