https://github.com/datnguye/diqu-email
diqu Adapter: Email
https://github.com/datnguye/diqu-email
diqu dynamic-template sendgrid
Last synced: 5 months ago
JSON representation
diqu Adapter: Email
- Host: GitHub
- URL: https://github.com/datnguye/diqu-email
- Owner: datnguye
- License: mit
- Created: 2023-11-26T08:01:10.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2025-06-19T03:29:28.000Z (7 months ago)
- Last Synced: 2025-07-01T04:06:34.512Z (6 months ago)
- Topics: diqu, dynamic-template, sendgrid
- Language: Python
- Homepage:
- Size: 341 KB
- Stars: 3
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# diqu-email
Alert module using Email method (Sendgrid)
## How to use
### Installation
```bash
pip install diqu
pip install diqu-email --upgrade
```
### Send email
Before you can send email with Sendgrid, go create your template first:
- Go to Email API / Dynamic Templates: Create a Dyanmic Template
- Design your template e.g.

- Save it and get the Template ID e.g. `d-c70732f1cb304d39823d52cd5cee8312`
- Go to Settings / API Keys: Get an API key e.g. SG.xxx.xxx
Now, you're ready to send alert:
```bash
export SENDGRID_API_KEY=YOURVALUE e.g. SG.xxx.xxx
export SENDGRID_MAILING_LIST=YOURVALUE e.g. dat@domain.com,dat2@domain.com
export SENDGRID_TEMPLATE_ID=YOURVALUE e.g. d-c70732f1cb304d39823d52cd5cee8312
# powershell
$env:SENDGRID_API_KEY="YOURVALUE"
$env:SENDGRID_MAILING_LIST="dat@domain.com,dat2@domain.com"
$env:SENDGRID_TEMPLATE_ID="d-c70732f1cb304d39823d52cd5cee8312"
diqu alert --to sendgrid
```
For a quick testing purpose, we can use the CSV package to run the [example](./example/) as following command:
```bash
diqu alert --to sendgrid --package csv --profile-name example --profiles-dir ./example
```
Here is the sample result:
