|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.xpn.xwiki.api.Api
com.xpn.xwiki.plugin.PluginApi<MailSenderPlugin>
com.xpn.xwiki.plugin.mailsender.MailSenderPluginApi
public class MailSenderPluginApi
Plugin that brings powerful mailing capabilities. This is the wrapper accessible from in-document scripts.
MailSender| Field Summary |
|---|
| Fields inherited from class com.xpn.xwiki.api.Api |
|---|
context |
| Constructor Summary | |
|---|---|
MailSenderPluginApi(MailSenderPlugin plugin,
com.xpn.xwiki.XWikiContext context)
API constructor. |
|
| Method Summary | |
|---|---|
Mail |
createMail()
A helper method for Velocity scripts since we cannot create Java objects from Velocity. |
MailConfiguration |
createMailConfiguration(com.xpn.xwiki.api.XWiki xwiki)
A helper method for Velocity scripts since we cannot create Java objects from Velocity. |
int |
sendHtmlMessage(java.lang.String from,
java.lang.String to,
java.lang.String cc,
java.lang.String bcc,
java.lang.String subject,
java.lang.String body,
java.lang.String alternative,
java.util.List<com.xpn.xwiki.api.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(java.lang.String from,
java.lang.String to,
java.lang.String cc,
java.lang.String bcc,
java.lang.String language,
java.lang.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 |
sendTextMessage(java.lang.String from,
java.lang.String to,
java.lang.String subject,
java.lang.String message)
Sends a simple text plain mail |
int |
sendTextMessage(java.lang.String from,
java.lang.String to,
java.lang.String cc,
java.lang.String bcc,
java.lang.String subject,
java.lang.String message,
java.util.List<com.xpn.xwiki.api.Attachment> attachments)
Sends a simple text plain mail with a list of files attachments |
| Methods inherited from class com.xpn.xwiki.plugin.PluginApi |
|---|
getInternalPlugin, getPlugin, getProtectedPlugin, setPlugin |
| Methods inherited from class com.xpn.xwiki.api.Api |
|---|
checkProgrammingRights, convert, convert, getXWikiContext, hasAccessLevel, hasAdminRights, hasProgrammingRights |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public MailSenderPluginApi(MailSenderPlugin plugin,
com.xpn.xwiki.XWikiContext context)
plugin - The wrapped plugin object.context - Context of the request.PluginApi.PluginApi(com.xpn.xwiki.plugin.XWikiPluginInterface,XWikiContext)| Method Detail |
|---|
public int sendHtmlMessage(java.lang.String from,
java.lang.String to,
java.lang.String cc,
java.lang.String bcc,
java.lang.String subject,
java.lang.String body,
java.lang.String alternative,
java.util.List<com.xpn.xwiki.api.Attachment> attachments)
sendHtmlMessage in interface MailSenderfrom - the senderto - the recipient of the messagecc - 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.
MailSender.sendHtmlMessage(String, String, String, String, String, String, String, java.util.List)
public int sendTextMessage(java.lang.String from,
java.lang.String to,
java.lang.String subject,
java.lang.String message)
sendTextMessage in interface MailSenderfrom - the senderto - the recipient of the messagesubject - the subject of the messagemessage - the body of the message
MailSender.sendTextMessage(String, String, String, String)
public int sendTextMessage(java.lang.String from,
java.lang.String to,
java.lang.String cc,
java.lang.String bcc,
java.lang.String subject,
java.lang.String message,
java.util.List<com.xpn.xwiki.api.Attachment> attachments)
sendTextMessage in interface MailSenderfrom - the senderto - the recipient of the messagecc - 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.
MailSender.sendTextMessage(String, String, String, String, String, String, java.util.List)
public int sendMessageFromTemplate(java.lang.String from,
java.lang.String to,
java.lang.String cc,
java.lang.String bcc,
java.lang.String language,
java.lang.String documentFullName,
org.apache.velocity.VelocityContext vcontext)
sendMessageFromTemplate in interface MailSenderfrom - 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
MailSender.sendMessageFromTemplate(String, String, String, String, String, String, VelocityContext)public Mail createMail()
createMail in interface MailSenderMailSender.createMail()public int sendMail(Mail mail)
sendHtmlXXX() and sendTextXXX() methods are specialized helper
versions of this generic method.
sendMail in interface MailSendermail - the already populated mail Object to be sent
MailSender.sendMail(Mail)public MailConfiguration createMailConfiguration(com.xpn.xwiki.api.XWiki xwiki)
createMailConfiguration in interface MailSenderxwiki - the XWiki object used to get the default values from the XWiki Preferences ("smtp_server" and
"smtp_from").
MailSender.createMailConfiguration(com.xpn.xwiki.api.XWiki)
public int sendMail(Mail mail,
MailConfiguration mailConfiguration)
sendHtmlXXX() and sendTextXXX() methods are
specialized helper versions of this generic method.
sendMail in interface MailSendermail - the already populated mail Object to be sentmailConfiguration - the configuration to use
MailSender.sendMail(Mail, MailConfiguration)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||