<
From version < 14.3 >
edited by Lyes BANDOU
on 2014/06/18
To version < 14.4 >
edited by Vincent Massol
on 2014/06/19
>
Change comment: There is no comment for this version

Summary

Details

Page properties
Author
... ... @@ -1,1 +1,1 @@
1 -XWiki.lyes
1 +XWiki.VincentMassol
Content
... ... @@ -81,27 +81,14 @@
81 81  
82 82  == Miscellaneous ==
83 83  
84 -The [[Mail Sender API>>extensions:Extension.Mail Sender API]] now allows:
85 -
86 -* Creating ##MimeMessageFactory## to generate pre-filled MimeMessage.
87 -
88 -Example of usage:
89 -
90 -(((
84 +* The [[Mail Sender API>>extensions:Extension.Mail Sender API]] now allows to send Mails from a Template. This is achieved with 2 calls:
85 +** One for setting the Subject from the Template. The following will generate a ##MimeMessage## with the subject pre-filled. The value will be that of the ##subject## xproperty from an ##XWiki.Mail## xobject in the Document pointed to by the passed ##documentReference##:(((
91 91  {{code language="none"}}
92 92  #set ($message = $services.mailsender.createMessage("template", documentReference, to))
93 93  #set ($message = $services.mailsender.createMessage("template", documentReference, from, to))
94 94  {{/code}}
95 -
96 -This will generated a MimeMessage with the subject pre-filled. The value will be that of the ##subject## xproperty from an ##XWiki.Mail## xobject in the Document pointed to by the passed ##documentReference##.
97 97  )))
98 -
99 -
100 -* Creating TemplateMimeBodyPartFactory to generate html body content with alternate text evaluated from template document containing a XWiki.Mail xobject.
101 -
102 -Example of usage:
103 -
104 -(((
91 +** One for setting the Body Part content from the Template:(((
105 105  {{code language="none"}}
106 106  $message.addPart("xwiki/template", $documentReference, {"velocityVariables" : { "var1" : "value1" }})
107 107  $message.addPart("xwiki/template", $documentReference, {"velocityVariables" : { "var1" : "value1" }, "attachments" : $attachments})

Get Connected