Search in sources :

Example 6 with NotificationEmail

use of com.yahoo.athenz.common.server.notification.NotificationEmail in project athenz by yahoo.

the class EmailNotificationService method notify.

@Override
public boolean notify(Notification notification) {
    if (notification == null) {
        return false;
    }
    NotificationEmail notificationAsEmail = notification.getNotificationAsEmail();
    if (notificationAsEmail == null) {
        return false;
    }
    final String subject = notificationAsEmail.getSubject();
    final String body = notificationAsEmail.getBody();
    Set<String> recipients = notificationAsEmail.getFullyQualifiedRecipientsEmail();
    return sendEmail(recipients, subject, body);
}
Also used : NotificationEmail(com.yahoo.athenz.common.server.notification.NotificationEmail)

Aggregations

NotificationEmail (com.yahoo.athenz.common.server.notification.NotificationEmail)6 Notification (com.yahoo.athenz.common.server.notification.Notification)5 Test (org.testng.annotations.Test)5 NotificationToEmailConverterCommon (com.yahoo.athenz.common.server.notification.NotificationToEmailConverterCommon)3 ZTSClientNotification (com.yahoo.athenz.zts.ZTSClientNotification)2