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

A .NET Core sample that receives and processes SparkPost webhook events

License

Notifications You must be signed in to change notification settings

SparkPost/azure-csharp-webhook-sample

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sign up for a SparkPost account and visit our Developer Hub for even more content.

SparkPost C# Webhooks Sample

This project contains a .NET Core service that consumes and processes SparkPost webhooks.

Deploy to Azure

Prerequisites

Installation

git clone https://github.com/SparkPost/azure-csharp-webhook-sample.git
cd SparkPostWebhooksSample
dotnet restore
dotnet ef database update
dotnet run

The service is now listening on port 5000. It expects to receive POST requests to the webhook endpoint http://localhost:5000/api/webhook containing valid SparkPost webhook batches in JSON format.

Usage

You can use ngrok to connect your local service to your SparkPost account nand send a test batch:

  1. Start ngrok: ngrok http 5000. Ngrok will create a tunnel and give you a public URL for your service.
  2. Create a new Webhook on your SparkPost Account that points to your ngrok tunnel URL.
  3. Use the webhook test facility in SparkPost to send a test batch to your service.

When you send email through your SparkPost account, your webhook service will periodically receive batches of real events.

Note: Remember to shut your service down, remove the tunnel and delete the webhook from your SparkPost account when you're finished.

Reference Material

About

A .NET Core sample that receives and processes SparkPost webhook events

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages