Magnolia 5.5 reached end of life on November 15, 2019. This branch is no longer supported, see End-of-life policy.
...
The Mail module is configured in /modules/mail
. Besides configuring SMTP settings the module is ready to use.
...
Javadoc resource link | ||||||
---|---|---|---|---|---|---|
|
...
Advanced Tables - Table Plus | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||||||||||||
|
...
Use the first tool to send test mails to verify your Configuring SMTP settings. The tool sends a pre-configured simple mail with an optional attachment to the email address in the logged in user's profile.
...
Advanced Tables - Table Plus | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||||||||||||
|
...
The second tool in the Verify setup subapp allows you to verify your mail message templates. Message templates are typically used by forms on pages to send the data to the user who submitted the form.
As in the case of verifying mail settings, the tool sends the test mail to the email address configured in your user profile.
...
...
Advanced Tables - Table Plus | |||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| |||||||||||||||||||||||||||||||||||
|
Properties:
templatesConfiguration | required Templates configuration node. | ||||||||
| required Template name. | ||||||||
| optional
| ||||||||
| optional Any parameters to be passed to the script. | ||||||||
| required Relative path to the template script. | ||||||||
| required Scripting language used in the template. | ||||||||
| optional Type of content for the message body. It is only necessary to include this property for HTML emails. | ||||||||
| optional Email address that will appear in the From field of the message, unless defined elsewhere, for example in Form module. | ||||||||
| optional Subject line of the email, unless defined elsewhere for example in the Form module. |
...
Advanced Tables - Table Plus | ||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||||||||||||||
|
...
renderers | optional Renderers node. |
| optional Renders FreeMarker email templates. |
| optional Renders Magnolia web pages in an email. |
| optional Renders simple text emails that do not require a specific scripting language to be parsed. |
Here's the example testFreemarker.html
template script.
...
This script requires two parameters, user
and path
, that need to be provided in the Data to send box in the verify templates tool. The parameters are passed to the template script and rendered in the message. Each parameter should be added on a single line in the <parameter name=<value>
format. For example:
...
Advanced Tables - Table Plus | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||||||
|
...
Advanced Tables - Table Plus | |||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| |||||||||||||||||||||||||||
|
...
<attachment name> | optional Attachment name. | ||||||||
| optional, default is Defines the structure of a
Values:
MailAttachment does not use Content-ID properties but uses attachment names (not file names). |
...
...
Create a template named, for example simpleTemplate.html
using Freemarker code.
Code Block |
---|
<html> <body> <p>Dear ${fullName},</p> <p>Please follow this link in order to validate your account: <a href="${href}">Verify your user</a></p> <p>Thank you!</p> </body> </html> |
/<CATALINA_HOME>/webapps/<contextPath>/templates/simpleTemplate.html
. You can put the template anywhere in the webapps
folder of a Magnolia instance. Register the new template in the /config/templatesConfiguration
node.
Advanced Tables - Table Plus | ||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||||||||||||||||||||
|
Info |
---|
Email applications and clients on the market display emails in different ways. The main reason for this is varied support for CSS styles. You can use a web based service such as Mailchimp Inbox Inspector to preview the message in various clients and work towards consistency. |