Skip to content

Latest commit

 

History

History
65 lines (53 loc) · 1.78 KB

notification.md

File metadata and controls

65 lines (53 loc) · 1.78 KB

Notification resources

Get notifications

for(NotificationEntity notification : mailQ.getNotifications()) {
    System.out.println(notification.getName());
}

Get notification

NotificationEntity notification = mailQ.getNotification(1L);
System.out.println(notification.getName());

Create notification

NotificationEntity notification = new NotificationEntity();
notification.setName("Order confirmation")
        .setSubject("Order confirmation")
        .setSendAs("Company inc.")
        .setTemplate("tHa42Av5s6==")
        .setAmpTemplate("QWx0ZXJuYXRpdmUgYmFzZTY0IGVtYWlsIHRleHQ=")
        .setAppliedSenderEmail("[email protected]")
        .setText("Your order is confirmed")
        .setCode("XS-12");
mailQ.createNotification(notification);

Update notification

NotificationEntity notification = mailQ.getNotification(1L);
notification.setName("Summer sale");
mailQ.updateNotification(notification);

Delete notification

mailQ.deleteNotification(1L);

Send notification

List<NotificationAttachmentEntity> attachments = new ArrayList<>();
NotificationAttachmentEntity attachment = new NotificationAttachmentEntity();
attachment.setSource("hUjA45ta==")
        .setMimeType("plain/text")
        .setLink("http://example.org")
        .setDisplayName("attachment.txt");
attachments.add(attachment);
NotificationDataEntity notificationData = new NotificationDataEntity();
notificationData.setRecipientEmail("[email protected]")
        .setDateFrom(LocalDateTime.now())
        .setReplyToEmail("[email protected]")
        .setBcc("[email protected]","[email protected]")
        .setCc("[email protected]")
        .setAttachments(attachments);
mailQ.sendNotificationEmail(264L,notificationData);