https://github.com/andrejmaya/aws-email-newsletter
Receive AWS newsletter around news, announcements, blog posts and more
https://github.com/andrejmaya/aws-email-newsletter
aws-lambda aws-sam aws-ses cloudformation
Last synced: 7 months ago
JSON representation
Receive AWS newsletter around news, announcements, blog posts and more
- Host: GitHub
- URL: https://github.com/andrejmaya/aws-email-newsletter
- Owner: andrejmaya
- Created: 2022-09-11T20:53:30.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2024-05-23T07:10:17.000Z (over 1 year ago)
- Last Synced: 2025-02-01T12:45:14.955Z (8 months ago)
- Topics: aws-lambda, aws-sam, aws-ses, cloudformation
- Language: Python
- Homepage:
- Size: 334 KB
- Stars: 2
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# AWS Newsletter via E-Mail :mailbox:

## Prerequisites :raising_hand:
* Active AWS credentials
* pip
* [AWS SAM CLI](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-cli-install.html)
* SES in production mode (see [here](https://docs.aws.amazon.com/ses/latest/dg/request-production-access.html))
* Verified Domains and/or E-Mail Id in SES (see [here](https://docs.aws.amazon.com/ses/latest/dg/creating-identities.html))## Installation :construction_worker:
1. Install python modules:
```
pip install -r src/newsletter_email/requirements.txt -t src/newsletter_email/dependencies/python
```
2. Run SAM deployment:
````
sam deploy --parameter-overrides \
EmailSender=noreply@stormfsi.de \
"EmailWhitelistPattern=(^[a-zA-Z0-9_.+-]+@reply\.(de|it|com|eu)$)" \
"MailFrequency=rate(7\ days)" \
CutoffDays=7 \
OpsEmailid= \
--guided
````See these example values for SAM:
```
Stack Name [sam-app]: awsnewsletteremailer
AWS Region [eu-central-1]:
Confirm changes before deploy [y/N]: N
Allow SAM CLI IAM role creation [Y/n]: Y
Disable rollback [y/N]: N
NewsletterSubscribersFunction may not have authorization defined, Is this okay? [y/N]: y
Save arguments to configuration file [Y/n]: Y
SAM configuration file [samconfig.toml]:
SAM configuration environment [default]:
```## Test locally
First of all you need to set `export LOCAL_TEST=true`.Then create a virtual env and run the newsletter.py
```
python3 -m venv /tmp/python_venv
. /tmp/python_venv/bin/activate
pip install -r src/newsletter_email/requirements.txt
cd src/newsletter_email
python newsletter.py
```## Usage :running:
Open the URL given in the output of the SAM deployment. Enjoy! :sunglasses: :star2: