Skip to content
This repository has been archived by the owner on Oct 26, 2021. It is now read-only.

Amazon Simple Email Service Notification Processing

License

Notifications You must be signed in to change notification settings

nager/Nager.AmazonSesNotification

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Nager.AmazonSesNotification

Amazon Simple Email Service Notification Processing

This project is a receiver for Amazon SES http/https Notifications. It can handle the default format or "Raw message delivery". The system also automatic subscribe to the sns webhook.

nuget

The package is available on nuget

PM> install-package Nager.AmazonSesNotification

Documentation

Recommended implementation

[Route("SesNotification")]
[HttpPost]
public async Task<IActionResult> SesNotificationAsync()
{
    var body = string.Empty;
    using (var reader = new StreamReader(Request.Body))
    {
        body = await reader.ReadToEndAsync();
    }
    
    var notificationProcessor = new NotificationProcessor();
    var result = await notificationProcessor.ProcessNotificationAsync(body);
    
    //Your processing logic...
    
    return StatusCode(StatusCodes.Status200OK);
 }

Works only if "Raw message delivery" disabled

[Route("SesNotification")]
[HttpPost]
public async Task<IActionResult> SesNotificationAsync(SnsMessage snsMessage)
{  
    var notificationProcessor = new NotificationProcessor();
    var result = await notificationProcessor.ProcessNotificationAsync(snsMessage);
    
    //Your processing logic...
    
    return StatusCode(StatusCodes.Status200OK);
 }