class EmailNotificationProcessorImpl implements EmailNotificationProcessor {

    @Override
    public void processNotification(@Nonnull final Long notificationId, @Nonnull final Map<String, String> secureProperties) {
        Assert.notNull(notificationId, "Email notification id should not be null");
        Assert.notNull(secureProperties, "Secure properties map should not be null");
        logger.debug("Sending email notification for id - {}", notificationId);
        /* Retrieve email notification */
        final EmailNotification emailNotification = emailNotificationService.getEmailNotificationForProcessing(notificationId);
        assertNotificationStateIsCreated(emailNotification);
        logger.debug("Successfully retrieved email notification - {}", emailNotification);
        /* Update notification state to PROCESSING */
        updateEmailNotificationState(emailNotification.getId(), NotificationState.PROCESSING);
        try {
            /* Start processing external email service operation */
            processMessage(emailNotification, secureProperties);
        } catch (final Exception ex) {
            final String message = "Error occurred while sending email notification with id - " + emailNotification.getId();
            logger.error(message, ex);
            /* Update state of notification to NotificationState.FAILED */
            updateEmailNotificationState(emailNotification.getId(), NotificationState.FAILED);
            throw new ServicesRuntimeException(message, ex);
        }
    }

      EmailNotificationProcessorImpl(final EmailNotificationService emailNotificationService,
                                   final EmailSenderProvider emailSenderProvider);

}