Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: add javadoc macros

...

Advanced Tables - Table Plus
enableHeadingAttributesfalse
enableSortingfalse
classm5-configuration-tree
enableHighlightingfalse


Node name

Mgnl f
modules

Mgnl f
mail

Mgnl f
apps

Mgnl f
fieldTypes

Mgnl f
config

Mgnl f
commands


Mail command

Javadoc resource link
rangeHigherVersion5.4
classNameinfo.magnolia.module.mail.commands.MailCommand
renderTypeasynchronous
is used to send all mails in Magnolia. The command can execute on events such as user actions, workflow steps and scheduled jobs. You can write message templates and test them manually in the Mail tools app before automating the process for production use.

The command is registered at Configuration > /modules/mail/commands/default/sendMail .

Advanced Tables - Table Plus
enableHeadingAttributesfalse
enableSortingfalse
classm5-configuration-tree
enableHighlightingfalse


Node nameValues

Mgnl f
modules

 

Mgnl f
mail

 

Mgnl f
commands

 

Mgnl f
default

 

Mgnl n
sendMail

 

Mgnl p
class

info.magnolia.module.mail.commands.MailCommand


...

The default transfer protocol (SMTP) settings are configured at Configuration > /modules/mail/config/smtp . These setting display the Mail subapp.

...

  • Access the relevant profile, typically superuser , in the Security app. Go to System users and add your email address in the superuser profile.
  • Select either plain text or rich text mail type.
  • Optionally, select an asset attachments from the DAM in the Assets chooser
  • Click Send Test Mail.

The content of the test mail is configured at Configuration > /modules/mail/config/simpleConfiguration .

Advanced Tables - Table Plus
enableHeadingAttributesfalse
enableSortingfalse
classm5-configuration-tree
enableHighlightingfalse


Node nameValue

Mgnl f
modules

 

Mgnl f
mail

 

Mgnl f
config

 

Mgnl n
simpleConfiguration

 

Mgnl p
body

This is a simple mail.

Mgnl p
from

test@example.com

Mgnl p
subject

 This This is a test mail.


Message templates

...

  • Properties:
    • templateFile: Mandatory. Relative path to the template script. 
    • type: Mandatory. Scripting language used in the template.
    • contentType: Type of content for the message body. It is only necessary to include this property for HTML emails.
    • from: Email address that will appear in the From field of the message, unless defined elsewhere, for example in Form module.
      subject: Subject line of the email, unless defined elsewhere for example in the Form module.
  • Nodes:
    • attachments: MailAttachment provides for a number of attachment options. 
    • parameters: Any parameters to be passed to the script.

      Advanced Tables - Table Plus
      enableHeadingAttributesfalse
      enableSortingfalse
      classm5-configuration-tree
      enableHighlightingfalse


      Node nameValue

      Mgnl f
      config

       

      Mgnl f
      templatesConfiguration

       

      Mgnl n
      testFreemarker

       

      Mgnl n
      attachments

       

      Mgnl n
      parameters

       

      Mgnl p
      contentType

      html

      Mgnl p
      from

      testfreemarker@example.com

      Mgnl p
      subject

       This This is a test email for freemarker template

      Mgnl p
      templateFile

       testFreemarkertestFreemarker.html

      Mgnl p
      type

      freemarker

      Mgnl n
      pageCommentsNotification

       



...

Template renderers are registered  in Configuration > /modules/mail/config/factory/renderers :

  • freemarker: To render Freemarker email templates.
  • magnolia: To render Magnolia web pages in an email.
  • simple: To render simple text emails that do not require a specific scripting language to be parsed.

    Advanced Tables - Table Plus
    enableHeadingAttributesfalse
    enableSortingfalse
    classm5-configuration-tree
    enableHighlightingfalse


    Node nameValue

    Mgnl f
    config

     

    Mgnl n
    factory

     

    Mgnl n
    renderers

     

    Mgnl p
    freemarker

    info.magnolia.module.mail.templates.impl.FreemarkerEmail

    Mgnl p
    magnolia

     infoinfo.magnolia.module.mail.templates.impl.MgnlPageEmail

    Mgnl p
    simple

     infoinfo.magnolia.module.mail.templates.impl.SimpleEmail

    Mgnl p
    class

     infoinfo.magnolia.module.mail.MgnlMailFactory



...

The mimeMultipart property can be used to define the structure of a MgnlMultipartEmail

Javadoc resource link
rangeHigherVersion5.4
classNameinfo.magnolia.module.mail.templates.MgnlMultipartEmail
renderTypeasynchronous
:

  • mixed: Standard email attachment.
  • related: Attachment shown inline. This is the default when no mimeMultipart property is speciied. MailAttachment does not use Content-ID properties but uses attachment names (not file names).

    Advanced Tables - Table Plus
    enableHeadingAttributesfalse
    enableSortingfalse
    classm5-configuration-tree
    enableHighlightingfalse


    Node nameValue

    Mgnl n
    <template configuration>

     

    Mgnl n
    attachments

     

    Mgnl n
    <attachment name>

     

    Mgnl p
    mimeMultipart

    mixed

    Mgnl p
    url

     http://www.magnolia-cms.com/.imaging/amplify-miami-2014/imageForTeaserBinary/miami.png

    Mgnl n
    <attachment name>

     

    Mgnl p
    mimeMultipart

    related

    Mgnl p
    url

     http://www.magnolia-cms.com/.imaging/amplify-miami-2014/imageForTeaserBinary/miami.png



...