Package io.jmix.emailtemplates
Interface EmailTemplateBuilder
- All Known Implementing Classes:
- EmailTemplateBuilderImpl
public interface EmailTemplateBuilder
That interface provides abilities of builder pattern to create filled email template 
EmailTemplate.
 There are a lot of 'set' and 'add' intermediate methods and five terminal methods.
 The implementation must contain copy of email template that have to filled by terminal methods.- 
Method SummaryModifier and TypeMethodDescriptionThat terminal method fills 'attachedFiles' property of email templateEmailTemplate.addAttachmentReport(Report report) That terminal method fills 'attachedTemplateReports' property of email templateEmailTemplateby oneTemplateReportfor that report.That terminal method fills 'bcc' property of email templateEmailTemplate.That terminal method fills 'cc' property of email templateEmailTemplate.That terminal method fills 'to' property of email templateEmailTemplate.build()That intermediate method creates copy of filledEmailTemplateThat intermediate method createsEmailInfoby filled email template usingEmailTemplates.voidThat intermediate method sends filled email templateEmailTemplateusingEmailer.voidsendEmail(boolean async) That intermediate method sends filled email templateEmailTemplateusingEmailer.voidThat intermediate method asynchronously sends filled email templateEmailTemplateusingEmailer.That terminal method fills 'attachedFiles' property of email templateEmailTemplate.setAttachmentParameter(Report report, String key, Object value) That terminal method fills 'attachedTemplateReports' property of email templateEmailTemplate.setAttachmentParameters(ReportWithParams reportWithParams) That terminal method fills 'attachedTemplateReports' property of email templateEmailTemplate.setAttachmentParameters(Report report, Map<String, Object> params) That terminal method fills 'attachedTemplateReports' property of email templateEmailTemplate.setAttachmentParameters(Collection<ReportWithParams> reportsWithParams) That terminal method fills 'attachedTemplateReports' property of email templateEmailTemplate.setAttachmentReports(Collection<Report> reports) That terminal method fills 'attachedTemplateReports' property of email templateEmailTemplateby collection ofTemplateReportfor each reports.That terminal method fills 'bcc' property of email templateEmailTemplate.setBodyParameter(String key, Object value) That terminal method fillsTemplateReportfor child entity of email templateEmailTemplate.setBodyParameters(Map<String, Object> params) That terminal method fillsTemplateReportof child entity of email templateEmailTemplate.That terminal method fills 'cc' property of email templateEmailTemplate.voidsetEmailTemplate(EmailTemplate emailTemplate) Clones specified email template and set it for the builder instanceThat terminal method fills 'from' property of email templateEmailTemplate.setSubject(String subject) That terminal method fills subject property of email templateEmailTemplate.That terminal method fills 'to' property of email templateEmailTemplate.
- 
Method Details- 
setEmailTemplateClones specified email template and set it for the builder instance- Parameters:
- emailTemplate- email template
 
- 
setSubjectThat terminal method fills subject property of email templateEmailTemplate.- Parameters:
- subject-- String
- Returns:
- EmailTemplateBuilder
 
- 
setFromThat terminal method fills 'from' property of email templateEmailTemplate.- Parameters:
- from-- String
- Returns:
- EmailTemplateBuilder
 
- 
addToThat terminal method fills 'to' property of email templateEmailTemplate. Addresses is added to already existed by the concatenation with ',' symbol.- Parameters:
- to-- String
- Returns:
- EmailTemplateBuilder
 
- 
setToThat terminal method fills 'to' property of email templateEmailTemplate.- Parameters:
- to-- String
- Returns:
- EmailTemplateBuilder
 
- 
addCcThat terminal method fills 'cc' property of email templateEmailTemplate. Addresses is added to already existed by the concatenation with ',' symbol.- Parameters:
- cc-- String
- Returns:
- EmailTemplateBuilder
 
- 
setCcThat terminal method fills 'cc' property of email templateEmailTemplate.- Parameters:
- cc-- String
- Returns:
- EmailTemplateBuilder
 
- 
addBccThat terminal method fills 'bcc' property of email templateEmailTemplate. Addresses is added to already existed by the concatenation with ',' symbol.- Parameters:
- bcc-- String
- Returns:
- EmailTemplateBuilder
 
- 
setBccThat terminal method fills 'bcc' property of email templateEmailTemplate.- Parameters:
- bcc-- String
- Returns:
- EmailTemplateBuilder
 
- 
addAttachmentReportThat terminal method fills 'attachedTemplateReports' property of email templateEmailTemplateby oneTemplateReportfor that report.- Parameters:
- report-- Report
- Returns:
- EmailTemplateBuilder
 
- 
setAttachmentReportsThat terminal method fills 'attachedTemplateReports' property of email templateEmailTemplateby collection ofTemplateReportfor each reports.- Parameters:
- reports- collection of- Report
- Returns:
- EmailTemplateBuilder
 
- 
addAttachmentFileThat terminal method fills 'attachedFiles' property of email templateEmailTemplate.- Parameters:
- file-- EmailTemplateAttachment
- Returns:
- EmailTemplateBuilder
 
- 
setAttachmentFilesThat terminal method fills 'attachedFiles' property of email templateEmailTemplate.- Parameters:
- files- list of- EmailTemplateAttachment
- Returns:
- EmailTemplateBuilder
 
- 
setBodyParameterThat terminal method fillsTemplateReportfor child entity of email templateEmailTemplate. If there are no reports with parameter with alias 'key', do nothing.- Parameters:
- key-- Stringis alias property of- ParameterValue
- value-- Objectwill be converted to defaultValue property of- ParameterValue
- Returns:
- EmailTemplateBuilder
 
- 
setBodyParametersThat terminal method fillsTemplateReportof child entity of email templateEmailTemplate. If there are no reports with parameter with aliases that contained in key set, do nothing.- Parameters:
- params-- Map
- Returns:
- EmailTemplateBuilder
 
- 
setAttachmentParameterThat terminal method fills 'attachedTemplateReports' property of email templateEmailTemplate. Method removes allTemplateReportwith same report if they exist.- Parameters:
- report- report
- key-- Stringis alias property of- ParameterValue
- value-- Objectwill be converted to defaultValue property of- ParameterValue
- Returns:
- EmailTemplateBuilder
 
- 
setAttachmentParametersThat terminal method fills 'attachedTemplateReports' property of email templateEmailTemplate. Method removes allTemplateReportwith same report if they exist.- Parameters:
- reportWithParams-- ReportWithParams
- Returns:
- EmailTemplateBuilder
 
- 
setAttachmentParametersThat terminal method fills 'attachedTemplateReports' property of email templateEmailTemplate. Method removes allTemplateReportwith same report if they exist.- Parameters:
- report-- Report
- params-- Map
- Returns:
- EmailTemplateBuilder
 
- 
setAttachmentParametersThat terminal method fills 'attachedTemplateReports' property of email templateEmailTemplate. Method removes allTemplateReportwith same report if they exist.- Parameters:
- reportsWithParams- collection of- ReportWithParams
- Returns:
- EmailTemplateBuilder
 
- 
generateEmailThat intermediate method createsEmailInfoby filled email template usingEmailTemplates.- Returns:
- EmailInfofrom Jmix emailer
- Throws:
- ReportParameterTypeChangedException- If parameter type of inputParameter does not equal to type saved in parameterValue.
- TemplateNotFoundException- If emailTemplate does not contain reports or null.
 
- 
buildEmailTemplate build()That intermediate method creates copy of filledEmailTemplate- Returns:
- EmailTemplatefrom Jmix emailer
 
- 
sendEmailvoid sendEmail() throws TemplateNotFoundException, ReportParameterTypeChangedException, EmailExceptionThat intermediate method sends filled email templateEmailTemplateusingEmailer.- Throws:
- ReportParameterTypeChangedException- If parameter type of inputParameter does not equal to type saved in parameterValue.
- TemplateNotFoundException- If emailTemplate does not contain reports or null.
- EmailException- if an error occurs during email sending
 
- 
sendEmailvoid sendEmail(boolean async) throws TemplateNotFoundException, ReportParameterTypeChangedException, EmailException That intermediate method sends filled email templateEmailTemplateusingEmailer.- Parameters:
- async- Provides choice of selecting asynchronous option.
- Throws:
- ReportParameterTypeChangedException- If parameter type of inputParameter does not equal to type saved in parameterValue.
- TemplateNotFoundException- If emailTemplate does not contain reports or null.
- EmailException- if an error occurs during email sending
 
- 
sendEmailAsyncThat intermediate method asynchronously sends filled email templateEmailTemplateusingEmailer.- Throws:
- ReportParameterTypeChangedException- If parameter type of inputParameter does not equal to type saved in parameterValue.
- TemplateNotFoundException- If emailTemplate does not contain reports or null.
 
 
-