|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface MailSender
Send mails to recipients (to, cc, bcc). Both text and HTML emails can be sent along with attachments. Also support XWiki page templates and allows sending a collection of emails in one call.
| Method Summary | |
|---|---|
Mail |
createMail()
A helper method for Velocity scripts since we cannot create Java objects from Velocity. |
MailConfiguration |
createMailConfiguration(XWiki xwiki)
A helper method for Velocity scripts since we cannot create Java objects from Velocity. |
int |
sendHtmlMessage(String from,
String to,
String cc,
String bcc,
String subject,
String body,
String alternative,
List<Attachment> attachments)
Sends an HTML mail, with a list of attachments |
int |
sendMail(Mail mail)
Generic method for sending emails. |
int |
sendMail(Mail mail,
MailConfiguration mailConfiguration)
Generic method for sending emails. |
int |
sendMessageFromTemplate(String from,
String to,
String cc,
String bcc,
String language,
String documentFullName,
org.apache.velocity.VelocityContext vcontext)
Uses an XWiki document to build the message subject and context, based on variables stored in the VelocityContext. |
int |
sendRawMessage(String from,
String to,
String rawMessage)
Sends a raw message. |
int |
sendTextMessage(String from,
String to,
String subject,
String message)
Sends a simple text plain mail |
int |
sendTextMessage(String from,
String to,
String cc,
String bcc,
String subject,
String message,
List<Attachment> attachments)
Sends a simple text plain mail with a list of files attachments |
| Method Detail |
|---|
Mail createMail()
MailConfiguration createMailConfiguration(XWiki xwiki)
xwiki - the XWiki object used to get the default values from the XWiki Preferences ("smtp_server" and
"smtp_from").
int sendMail(Mail mail)
sendHtmlXXX() and sendTextXXX() methods are specialized helper
versions of this generic method.
mail - the already populated mail Object to be sent
int sendMail(Mail mail,
MailConfiguration mailConfiguration)
sendHtmlXXX() and sendTextXXX() methods are
specialized helper versions of this generic method.
mail - the already populated mail Object to be sentmailConfiguration - the configuration to use
int sendHtmlMessage(String from,
String to,
String cc,
String bcc,
String subject,
String body,
String alternative,
List<Attachment> attachments)
to - the recipient of the messagefrom - the sendercc - carbon copybcc - hidden carbon copysubject - the subject of the messagebody - the body content of the mailalternative - the alternative text offered to the mail clientattachments - List of com.xpn.xwiki.api.Attachment that will be attached to the mail.
int sendTextMessage(String from,
String to,
String subject,
String message)
to - the recipient of the messagefrom - the sendersubject - the subject of the messagemessage - the body of the message
int sendTextMessage(String from,
String to,
String cc,
String bcc,
String subject,
String message,
List<Attachment> attachments)
to - the recipient of the messagefrom - the sendercc - carbon copybcc - hidden carbon copysubject - the subject of the messagemessage - the body of the messageattachments - List of com.xpn.xwiki.api.Attachment that will be attached to the mail.
int sendRawMessage(String from,
String to,
String rawMessage)
from - the senderto - the receiverrawMessage - the raw message, containing additional headers and the actual message
int sendMessageFromTemplate(String from,
String to,
String cc,
String bcc,
String language,
String documentFullName,
org.apache.velocity.VelocityContext vcontext)
from - Email senderto - Email recipientcc - Email Carbon Copybcc - Email Hidden Carbon Copylanguage - Language of the emaildocumentFullName - Full name of the template to be used (example: XWiki.MyEmailTemplate). The template needs
to have an XWiki.Email object attachedvcontext - Velocity context passed to the velocity renderer
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||