Zdrojový kód wiki XWIKI - Nová index stránka
Version 29.1 by David Brazda on 18.12.2020 21:53
Show last authors
author | version | line-number | content |
---|---|---|---|
1 | Úvodní stránka nové subwiki. Měním tuto stránku. | ||
2 | |||
3 | {{velocity}}#set ($message = $services.mail.sender.createMessage("localhost@xwiki.org", "john@doe.com", "subject")) | ||
4 | #set ($discard = $message.addPart("text/plain", "text content")) | ||
5 | #set ($mailResult = $services.mail.sender.send($message)) | ||
6 | ## Check if the message was created properly and if we have permissions to send emails | ||
7 | #if ($services.mail.sender.lastError) | ||
8 | {{error}}$exceptiontool.getStackTrace($services.mail.sender.lastError){{/error}} | ||
9 | #end | ||
10 | ## Check if the mail we tried to send has failed to be sent | ||
11 | ## XWiki < 7.1 use #set ($statuses = $mailResult.statusResult.getByState('FAILED')) | ||
12 | #set ($statuses = $mailResult.statusResult.getAllErrors()) | ||
13 | #if ($statuses.hasNext()) | ||
14 | #set ($status = $statuses.next()) | ||
15 | {{error}} | ||
16 | Error: $status.errorSummary ($status.state) | ||
17 | |||
18 | $status.errorDescription | ||
19 | {{/error}} | ||
20 | #end{{/velocity}} | ||
21 |