public class PreRenderedMailNotificationQueueItem extends MailNotificationQueueItem implements com.atlassian.mail.queue.MailQueueItem
Modifier and Type | Class and Description |
---|---|
static class |
PreRenderedMailNotificationQueueItem.Builder
A builder for
PreRenderedMailNotificationQueueItems . |
TEMPLATES_LOCATION
body, dateQueued, MIME_TYPE_HTML, MIME_TYPE_TEXT
Modifier and Type | Method and Description |
---|---|
void |
addDatasources(Collection<DataSource> datasources)
Deprecated.
since 5.2, prefer using
Builder#andRelatedBodyParts(Collection) instead as this method could be called after send() |
static MailNotificationQueueItem |
createFromTemplateContent(com.atlassian.user.User recipient,
String templateContent,
String subject)
Deprecated.
since 5.2, use
with(User, String, String) instead |
static PreRenderedMailNotificationQueueItem |
createFromTemplateFile(com.atlassian.user.User recipient,
String templateFileName,
String subject)
Deprecated.
since 5.2, use
with(User, String, String) instead |
static PreRenderedMailNotificationQueueItem |
createFromTemplateFileAndContext(com.atlassian.user.User recipient,
NotificationData notificationData,
String subject,
Map<String,Object> contextMap)
Deprecated.
since 4.3, use
with(User, String, String) instead |
static PreRenderedMailNotificationQueueItem |
createFromTemplateFileAndContext(com.atlassian.user.User recipient,
NotificationData notificationData,
String subject,
NotificationContext contextClone)
Deprecated.
since 5.2, use
with(User, String, String) instead |
static PreRenderedMailNotificationQueueItem |
createFromTemplateFileAndContext(com.atlassian.user.User recipient,
String templateFileName,
String subject,
Map<String,Object> contextMap,
com.atlassian.user.User modifier)
Deprecated.
since 5.2, use
with(User, String, String) instead |
static PreRenderedMailNotificationQueueItem |
createFromTemplateFileAndContext(com.atlassian.user.User recipient,
com.atlassian.user.User modifier,
String templateName,
String subject,
Collection<DataSource> templateImageDataSources,
Map<String,Object> contextMap)
Deprecated.
since 5.2, use
with(User, String, String) instead |
static MailNotificationQueueItem |
createFromTemplateFileAndLocation(com.atlassian.user.User recipient,
String templateLocation,
String templateFileName,
String subject)
Deprecated.
since 5.2, use
with(User, String, String) instead |
protected com.atlassian.mail.Email |
createMailObject() |
void |
render() |
protected String |
renderTemplate(String templateLocation,
String templateName,
Map<String,Object> contextMap) |
void |
send() |
static PreRenderedMailNotificationQueueItem.Builder |
with(com.atlassian.user.User recipient,
String templateFileName,
String subject)
Mandatory parametrisation in order to construct a
PreRenderedMailNotificationQueueItem instance. |
getDefaultTemplateLocation, getMimeType, getMimeTypeForUser, getTemplateLocationFromUserPreference, getUserAccessor
addVelocityContextParam, clearContext, compareTo, execute, getBody, getDateQueued, getLastError, getRenderedContent, getRenderedContent, getSendCount, getSubject, getTemplateContent, getTemplateFileName, getTemplateLocation, getVelocityContextParam, hasError, incrementSendCount, isRecognisedMimeType, preRenderBody, removeVelocityContextParam, retrieveMailServer, setBody, setLastError, setSubject, setTemplateContent, setTemplateFileName, setTemplateLocation, transformForEmail
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getDateQueued, getSendCount, getSubject, hasError
compareTo
@Deprecated public static PreRenderedMailNotificationQueueItem createFromTemplateFile(com.atlassian.user.User recipient, String templateFileName, String subject)
with(User, String, String)
instead@Deprecated public static PreRenderedMailNotificationQueueItem createFromTemplateFileAndContext(com.atlassian.user.User recipient, NotificationData notificationData, String subject, Map<String,Object> contextMap)
with(User, String, String)
insteadrecipient
- the recipientnotificationData
- the notification datasubject
- the subjectcontextMap
- the context map for this email.@Deprecated public static PreRenderedMailNotificationQueueItem createFromTemplateFileAndContext(com.atlassian.user.User recipient, NotificationData notificationData, String subject, NotificationContext contextClone)
with(User, String, String)
insteadrecipient
- the recipientnotificationData
- the notification datasubject
- the subjectcontextClone
- a clone of the context of notificationData obtained by NotificationData.cloneContext()
.
Values can be overridden for one instance of notification, for example the i18n bean.public static PreRenderedMailNotificationQueueItem createFromTemplateFileAndContext(com.atlassian.user.User recipient, com.atlassian.user.User modifier, String templateName, String subject, Collection<DataSource> templateImageDataSources, Map<String,Object> contextMap)
with(User, String, String)
instead@Deprecated public static PreRenderedMailNotificationQueueItem createFromTemplateFileAndContext(com.atlassian.user.User recipient, String templateFileName, String subject, Map<String,Object> contextMap, com.atlassian.user.User modifier)
with(User, String, String)
instead@Deprecated public static MailNotificationQueueItem createFromTemplateFileAndLocation(com.atlassian.user.User recipient, String templateLocation, String templateFileName, String subject)
with(User, String, String)
instead@Deprecated public static MailNotificationQueueItem createFromTemplateContent(com.atlassian.user.User recipient, String templateContent, String subject)
with(User, String, String)
insteadpublic static PreRenderedMailNotificationQueueItem.Builder with(com.atlassian.user.User recipient, String templateFileName, String subject)
PreRenderedMailNotificationQueueItem
instance.
The templateFileName
denotes the templating technology to be used. E.g. parametrising the
constructor with myTemplateFile.vm
will lead to Apache
Velocity being used as the engine, or myTemplateFile.soy
will lead to Google Closure Templates being used.
recipient
- the recipient of this emailtemplateFileName
- the name of the templatesubject
- the subject, assumed to be pre-renderedspecifying the template's location
,
specifying if the subject gets rendered
public void render()
public final void send() throws com.atlassian.mail.MailException
send
in interface com.atlassian.mail.queue.MailQueueItem
send
in class AbstractMailNotificationQueueItem
com.atlassian.mail.MailException
protected com.atlassian.mail.Email createMailObject()
createMailObject
in class MailNotificationQueueItem
public void addDatasources(Collection<DataSource> datasources)
Builder#andRelatedBodyParts(Collection)
instead as this method could be called after send()
protected String renderTemplate(String templateLocation, String templateName, Map<String,Object> contextMap)
renderTemplate
in class AbstractMailNotificationQueueItem
Copyright © 2003–2016 Atlassian. All rights reserved.