◆ NewsletterTemplate()
org.turro.newsletter.NewsletterTemplate.NewsletterTemplate |
( |
Newsletter |
newsletter | ) |
|
◆ close()
void org.turro.newsletter.NewsletterTemplate.close |
( |
| ) |
throws IOException |
◆ getMailMessage()
Definition at line 54 of file NewsletterTemplate.java.
56 if(pool ==
null) pool = MailProviders.instance().getGeneric();
57 MailMessageTemplate mmt = MailMessageTemplate.of(pool.getProvider());
58 mmt.setProcessLiveLinks(
true);
59 mmt.setSubject(getTitle());
60 mmt.addTo(contact.getEmail(), contact.getName());
61 ElephantMarker em =
new ElephantMarker(Application.getApplication().getConstructor(),
true);
62 em.put(
"newsletter", newsletter);
64 em.put(
"newsSection" + ns.getNewsOrder(), ns);
66 em.put(
"contact", contact);
67 em.put(
"email", contact.getEmail());
68 mmt.setRoot(
"/newsletter/tmp");
71 }
catch (EmailException ex) {
72 Logger.getLogger(
NewsletterTemplate.class.getName()).log(Level.SEVERE, ElephantContext.logMsg(
null), ex);
NewsletterTemplate(Newsletter newsletter)
String getTemplate(IContact contact)
Set< NewsSection > getNewsSections()
◆ getTemplate()
String org.turro.newsletter.NewsletterTemplate.getTemplate |
( |
IContact |
contact | ) |
|
Definition at line 77 of file NewsletterTemplate.java.
79 if(
template ==
null) {
80 File rootTmp =
new File(ElephantContext.getRealPath(
"/WEB-INF/elephant/templates-mail/content/newsletter/tmp"));
82 template = File.createTempFile(
"news",
"Template.html", rootTmp);
83 try (PrintWriter fw =
new PrintWriter(
template, ElephantContext.getEncoding())) {
87 return extractName(
template);
88 }
catch (IOException ex) {
89 Logger.getLogger(
NewsletterTemplate.class.getName()).log(Level.SEVERE, ElephantContext.logMsg(
null), ex);
void generateNewsletter(IContact contact, Writer writer)
◆ releaseTemplate()
void org.turro.newsletter.NewsletterTemplate.releaseTemplate |
( |
| ) |
|
The documentation for this class was generated from the following file: