Mail Module
1. Goals
We already have a mail module and it is used in workflows or in the current sample module.
- send magnolia pages
- easy to use
- usable together with the Form module
- cleanup
2. Improvements
- attachments both methods - plain text / html - must be supported and both must be able handle attachments. For that we have to clean up the current class hierarchy
- parameters A parameter map to process the mail template can be passed.
- form processor A default implementation of a form processor must be delivered
- mail command Both the mail command and the processor should use the same code to send and render the template
- UI for sending a page
- dynamic subject The subject must allow dynamic values (being a small freemarker template too)
- drop velocity support This is more confusing than really helpful. Now that we use freemarker everywhere we should stick to it
- deprecate simple mail tag The form processor is much more flexible
Current mail module structure
Hierarchy:
---
MgnlEmail
| |
MgnlMultipart SimpleEmail
|
HtmlEmail
| |
FreemarkerEmail VelocityEmail
l
MagnoliaEmail - sends magnolia pages
----
Problem: Only ones that extend HtmlMail can have attachmentsl.
MgnlMailServlet - extract parameters and calls to MailCommand.
MgnlMailFactory / MgnlMailTypeFactory - create email based on the type.
Configuration in the module, there you register your templates.
Proposed changes
New hierarchy:
BaseEmail
|
MgnlMultipart
| | |
FreemarkerEmail VelocityEmail
|
MagnoliaEmail?? not sure yet
SimpleEmail, Htmlemail - deprecated