https://github.com/askrella/aws-ses-mock
AWS SES simulator for e2e testing e.g. in pipelines :gear:
https://github.com/askrella/aws-ses-mock
aws aws-ses email emulator mock
Last synced: about 1 month ago
JSON representation
AWS SES simulator for e2e testing e.g. in pipelines :gear:
- Host: GitHub
- URL: https://github.com/askrella/aws-ses-mock
- Owner: askrella
- License: mit
- Created: 2023-02-24T21:04:31.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2024-04-30T08:49:34.000Z (over 1 year ago)
- Last Synced: 2024-04-30T10:04:04.426Z (over 1 year ago)
- Topics: aws, aws-ses, email, emulator, mock
- Language: Go
- Homepage:
- Size: 55.7 KB
- Stars: 13
- Watchers: 2
- Forks: 2
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
# AWS SES Mock
[](https://opensource.org/licenses/MIT)




We created this project as a new version of aws-ses-local, which doesn't seem to be maintained for a few years.
Our goal is to provide more features, small containers and be more accurate than the alternatives.# :gear: Getting Started
## Running the Docker Container
```bash
docker run -p 8081:8081 ghcr.io/askrella/aws-ses-mock:1.0.30
```## Usage with NodeJS
Using the AWS SDK you can set the endpoint for SES manually by specifying the endpoint in your configuration:
```javascript
import AWS from 'aws-sdk'
const ses = new AWS.SES({ region: 'us-east-1', endpoint: 'http://localhost:8080' })
```## Usage with Golang
Using the AWS SDK you can set the endpoint for SES manually by overriding the endpoint resolver:
```golang
customResolver := aws.EndpointResolverWithOptionsFunc(func(service, region string, options ...interface{}) (aws.Endpoint, error) {
if overrideEndpoint, exists := os.LookupEnv("OVERRIDE_SES_ENDPOINT"); exists {
return aws.Endpoint{
PartitionID: "aws",
URL: overrideEndpoint,
SigningRegion: "eu-central-1",
}, nil
}return aws.Endpoint{}, &aws.EndpointNotFoundError{}
})cfg, err := config.LoadDefaultConfig(context.TODO(), config.WithRegion("eu-central-1"), config.WithEndpointResolverWithOptions(customResolver))
```## Manual testing
The `POST` endpoint is available under `http://localhost:8080/` and should contain the raw JSON body used for SES messages:
```json
{
"Action": "SendEmail",
"Destination": {
"ToAddresses": [
"recipient@example.com"
],
"CcAddresses": [
"cc@example.com"
],
"BccAddresses": [
"bcc@example.com"
]
},
"Message": {
"Body": {
"Text": {
"Data": "This is the message body in plain text format."
},
"Html": {
"Data": "Hello World!
This is the message body in HTML format.
"
}
},
"Subject": {
"Data": "Test email"
}
},
"Source": "sender@example.com",
"ReplyToAddresses": [
"reply-to@example.com"
]
}
```## :test_tube: Running Tests
To run tests, run the following command
```bash
go test ./internal/*
```# :wave: Contributors
* [Askrella Software Agency](askrella.de)
* [Steve](https://github.com/steve-hb) (Maintainer)
* [Navo](https://github.com/navopw) (Maintainer)Feel free to open a new pull request with changes or create an issue here on GitHub! :)
# :warning: License
Distributed under the MIT License. See LICENSE.txt for more information.# :handshake: Contact Us
In case you need professional support, feel free to contact us