Skip to content

Latest commit

 

History

History
43 lines (40 loc) · 1.15 KB

README.md

File metadata and controls

43 lines (40 loc) · 1.15 KB

Requirements

  • Maven
  • Apache Tomcat

* A Dockerfile with Tomcat 9.0 is provided

Configuration

  • Make sure the variables are correctly set in Env.kt
const val FROM = "[email protected]"
const val TO = "[email protected]"
  • Create an SNS topic
  • Create a Configuration Set on Amazon SES, direct it to the SNS Topic and make sure the configuration set name is correct on Env.kt
const val CONFIGURATION_SET = "default"
  • After the service is running, subscribe the SNS topic to your endpoint, or to a proxy endpoint

I've used https://webhook.site/ and then reproduced the request locally using Postman

Usage

  • Build the WAR with mvn clean package
  • If using Dockerfile:
docker build . -t aws-sns-sample
docker run -it -p 8080:8080 aws-sns-sample
  • Verify the service is running:
GET request to http://localhost:8080/api/ping
  • Send an email without special characters:
POST http://localhost:8080/api/send-without-special
  • Send an email with special characters:
POST http://localhost:8080/api/send
  • Send the SNS notification request to:
POST http://localhost:8080/api/handle