for (NewsletterEntity newsletter: mailQ.getNewsletters()) {
System.out.println(newsletter.getName());
}
Sender e-mail has to be created. See resource Sender email.
List<AttachmentEntity> attachments = new ArrayList<>();
AttachmentEntity attachmentEntity = new AttachmentEntity();
attachmentEntity.setDisplayName("attachment.jpg")
.setLink("http://example.org/1.jpg")
.setMimeType("image/jpeg")
.setSource("LzlqLzRBQ==");
attachments.add(attachmentEntity);
NewsletterEntity newsletter = new NewsletterEntity();
newsletter.setCampaign("Winter sales")
.setName("Example newsletter")
.setSubject("20% sale")
.setCode("XY-123")
.setRecipientsListId(1L)
.setSendAs("Company inc.")
.setSenderEmail("newsletter@example.org")
.setTemplateUrl("http://example.org/newsletter.html")
.setAmpTemplateUrl("http://example.org/ampnewsletter.html")
.setUnsubscribeTemplateUrl("http://example.org/unsubscribe.html")
.setAutomaticTime(false)
.setFrom(LocalDateTime.now().plusHours(5))
.setTo(LocalDateTime.now().plusYears(1))
.setTags("winter","sale")
.setAttachments(attachments);
newsletter = mailQ.createNewsletter(newsletter);
System.out.println(newsletter.getId());
for (TagEntity tag : mailQ.getNewslettersTags()) {
System.out.println(tag.getName());
}
NewsletterEntity newsletter = mailQ.getNewsletter(1L);
System.out.println(newsletter.getName());
NewsletterEntity newsletter = mailQ.getNewsletterByCode("test");
System.out.println(newsletter.getName());
NewsletterEntity newsletter = mailQ.getNewsletter(1L);
newsletter.setName("Summer sale");
mailQ.updateNewsletter(newsletter);
mailQ.deleteNewsletter(1L);
mailQ.startNewsletter(1L);
mailQ.stopNewsletter(1L);
mailQ.sendTestEmail(1L,"john.doe@example.org")