https://github.com/licenseware/send-email-notification
Github action that will send email notification using SendGrid Email API
https://github.com/licenseware/send-email-notification
actions cicd docker dockerfile email github-action github-actions python python3 sendgrid sendgrid-api sendgrid-mail
Last synced: about 1 month ago
JSON representation
Github action that will send email notification using SendGrid Email API
- Host: GitHub
- URL: https://github.com/licenseware/send-email-notification
- Owner: licenseware
- License: apache-2.0
- Created: 2022-03-02T17:09:20.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2026-04-20T20:34:05.000Z (about 1 month ago)
- Last Synced: 2026-04-20T22:33:14.839Z (about 1 month ago)
- Topics: actions, cicd, docker, dockerfile, email, github-action, github-actions, python, python3, sendgrid, sendgrid-api, sendgrid-mail
- Language: Python
- Homepage:
- Size: 66.4 KB
- Stars: 13
- Watchers: 2
- Forks: 5
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Send Email Notification
[](./.pre-commit-config.yaml)
[](./LICENSE)
- [Send Email Notification](#send-email-notification)
- [Send email to one address](#send-email-to-one-address)
- [Send email to multiple addresses upon Github release](#send-email-to-multiple-addresses-upon-github-release)
- [Send email with attachments](#send-email-with-attachments)
- [Run Docker Container Locally](#run-docker-container-locally)
Using [the Sendgrid Python library](https://pypi.org/project/sendgrid/), send
email to people with the content & subject of your choice.
This repository is used inside Github Actions in the following format:
## Send email to one address
```yaml
- uses: licenseware/send-email-notification@v1.2.0
with:
api-key: ${{ secrets.SENDGRID_API_KEY }}
subject: Test Subject
from-email: verified-email@licenseware.io
to-email: john-doe@licenseware.io
markdown-body: |
# My Markdown Title
This is a description
## Another header
Another description
```
## Send email to multiple addresses upon Github release
```yaml
on:
release:
types:
- published
jobs:
release-notification:
name: release notification
runs-on: ubuntu-latest
strategy:
matrix:
to-emails:
- receiver1@licenseware.io
- receiver2@licenseware.io
- receiver3@licenseware.io
steps:
- uses: licenseware/send-email-notification@v1.2.0
with:
api-key: ${{ secrets.SENDGRID_API_KEY }}
subject: New Release ${{ github.repository }}:${{ github.ref_name }}
from-email: verified-email@licenseware.io
to-email: ${{ matrix.to-emails }}
markdown-body: ${{ github.event.release.body }}
```
## Send email with attachments
```yaml
- uses: licenseware/send-email-notification@v1.2.0
with:
api-key: ${{ secrets.SENDGRID_API_KEY }}
subject: Test Subject
from-email: verified-email@licenseware.io
to-email: some-dude@licenseware.io
markdown-body: |
Hey, check out this file
attachments: |
./path/to/file1.txt
./path/to/file2.txt
# optionally, a list of zero, one, or the same size {inline, attachment}
attachments-disposition: |
attachment
attachment
```
## Use eu region
```yaml
- uses: licenseware/send-email-notification@v1.2.0
with:
api-key: ${{ secrets.SENDGRID_API_KEY }}
region: eu
subject: Test Subject
from-email: verified-email@licenseware.io
to-email: john-doe@licenseware.io
markdown-body: |
Mail body
```
## Run Docker Container Locally
Grab the latest tag from here:
[](https://github.com/licenseware/send-email-notification/pkgs/container/send-email-notification)
```bash
export SENDGRID_API_KEY="CHANGE_THIS"
docker run --rm \
--name send-email-notification \
ghcr.io/licenseware/send-email-notification \
--api-key=${SENDGRID_API_KEY} \
--from=info@example.com \
--to=john@example.com \
--subject="Send email notifications" \
--markdown-body="""
# Send email notifications
Checkout this cool repository:
"""
```