Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-10510

Add ability to send emails from a Template document containing a XWiki.Mail xobject

    XMLWordPrintable

Details

    • New Feature
    • Resolution: Fixed
    • Major
    • 6.1-rc-1
    • 6.1-rc-1
    • Mail
    • None
    • Unit
    • Unknown

    Description

      The goal is to add support for the following example:

      {{velocity}}
      #set ($message = $services.mailsender.createMessage("localhost@xwiki.org", "john@doe.com", "subject test"))
      #set ($discard = $message.addPart("xwiki/template", $services.model.createDocumentReference('', 'Main', 'TemplateMail'), {"velocityVariables" : { "var1" : "value1" }}))
      or 
      #set ($discard = $message.addPart("xwiki/template", $services.model.createDocumentReference('', 'Main', 'TemplateMail'), {"velocityVariables" : { "var1" : "value1" }, "attachements": $attachments}))
      #set ($discard = $message.send())
      {{/velocity}}
      

      Attachments

        Activity

          People

            lyes Bandou Lyes
            lyes Bandou Lyes
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: