Class PreRenderedMailNotificationQueueItem.Builder
- Enclosing class:
- PreRenderedMailNotificationQueueItem
PreRenderedMailNotificationQueueItems.
 This builder unifies the different factory methods provided on the item's class.
- Since:
- 5.2
- See Also:
- 
Method SummaryModifier and TypeMethodDescriptionandContext(Map<String, Object> context) andContextEntry(String key, Object value) Add an entry to the context used for rendering the body.andRelatedBodyPart(DataSource relatedBodyPart) andRelatedBodyParts(Iterable<? extends DataSource> relatedBodyParts) andReplyTo(String replyToEmail) andSender(com.atlassian.user.User sender) andTemplateLocation(String templateLocation) Set the location of the template specified astemplateFileNamein the constructor.build()Constructs an instance ofPreRenderedMailNotificationQueueItem.render()Constructs an instance ofPreRenderedMailNotificationQueueItemand renders the body.
- 
Method Details- 
andTemplateLocationSet the location of the template specified astemplateFileNamein the constructor.For Velocity templates, e.g. any templateFileNameending with .vm, this has to be path relative to the webapp starting and ending with '/'. ThetemplateLocationis concatenated with thetemplateFileNameand then fed intoVelocityUtils.getRenderedContent(String, Map).For any other template, e.g. any templateFileNameending with .soy indicating that this is a Google Closure Template, the location has to be a complete key pointing to a web-resource declaring the template.
 The plugin system defines a complete key as a unique identifier for a plugin module. It is composed of a plugin key and a module key separated by a colon.
 E.g.
 <atlassian-plugin key="myPluginKey" plugins-version="2"> <web-resource key="templates"> <resource type="soy" name="content" location="templates/myTemplate.soy"/> </web-resource> </atlassian-plugin>would mean that the complete key and thus the templateLocationfor this file ismyPluginKey:templates.The builder will default to MailNotificationQueueItem.getDefaultTemplateLocation(User, String).
- 
andSender- Parameters:
- sender- the sender of this email
 
- 
andReplyTo- Parameters:
- replyToEmail- the email address that will be used for replying to
 
- 
andRelatedBodyPart- Parameters:
- relatedBodyPart- encapsulates a binary, e.g. an image, to be added to the email's- related- Multipart
- See Also:
 
- 
andRelatedBodyPartspublic PreRenderedMailNotificationQueueItem.Builder andRelatedBodyParts(Iterable<? extends DataSource> relatedBodyParts) - See Also:
 
- 
andContextEntryAdd an entry to the context used for rendering the body.
- 
andContext- See Also:
 
- 
buildConstructs an instance ofPreRenderedMailNotificationQueueItem.The context added to the builder will be attached to the item. You will need to call PreRenderedMailNotificationQueueItem.render()before attaching the task to aTaskManager.- See Also:
 
- 
renderConstructs an instance ofPreRenderedMailNotificationQueueItemand renders the body.The context added to the builder will not be attached to the item. This means calling PreRenderedMailNotificationQueueItem.render()is not necessary and in fact erroneous.
 
-