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

Latest commit

 

History

History
51 lines (40 loc) · 1.57 KB

README.md

File metadata and controls

51 lines (40 loc) · 1.57 KB

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);
 }