Skip to main content

sendgrid-cli

A very simple SendGrid CLI written in Python with only basic functionalities (at this moment).

The official sendgrid-cli hasn't been updated in years and I couldn't get it to work,
so I wrote this with only the features I need.

If you need more features, feel free to contribute by submitting pull requests.

Installation

pipx

This is the recommended installation method.

$ pipx install sendgrid-cli

pip

$ pip install sendgrid-cli

Usage

On the command line

usage: sendgrid [-h] [-V] [-t str [str ...]] [-f str] [-n str] [-s str]

sendgrid CLI

options:
  -h, --help            show this help message and exit
  -V, --version         show program's version number and exit
  -t str [str ...], --to-emails str [str ...]
                        To emails (default: None)
  -f str, --from-email str
                        From email EMAIL (default: None)
  -n str, --from-name str
                        From name NAME (default: None)
  -s str, --subject str
                        Subject (default: None)
  -H, --html            send as html instead of plain text (default: False)

Email body (HTML) is read from stdin, supply your API key with SENDGRID_API_KEY environment variable

On GitHub Actions

Below is a working job configuration

  send-mail:
    runs-on: ubuntu-latest
    steps:
      - name: setup python 3.10
        uses: actions/setup-python@v4
        with:
          python-version: '3.10'
      - name: install CLI tools
        run: pipx install sendgrid-cli
      - name: Send email
        env:
          SENDGRID_API_KEY: ${{ secrets.SENDGRID_API_KEY }}
        run: |
          cat email-body.html | sendgrid -f 'from@example.com' -n 'from-name' -t 'to@example.com' -s 'sendgrid-cli test' --html

Develop

$ git clone https://github.com/tddschn/sendgrid-cli.git
$ cd 
$ poetry install

Metadata

Release files for sendgrid-cli 0.1.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sendgrid-cli 0.1.4
File Size Uploaded
sendgrid-cli-0.1.4.tar.gz 3.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for sendgrid-cli 0.1.4
File Interpreter ABI Platform
sendgrid_cli-0.1.4-py3-none-any.whl Python 3 none any Details

Total release size: 6.8 kB

Release files / sendgrid-cli-0.1.4.tar.gz

Download URL sendgrid-cli-0.1.4.tar.gz
Size 3.3 kB
Tags Source
SHA-256 checksum
How to use checksums
3050353a3754b206b2e1dbd08832d366eddf1a042d780c6679355bfdecaf5258
BLAKE2b-256 checksum
How to use checksums
65e69591dae0331e96482ccc94f25bf625e9e5a586a1eb8da6a5c844b4d3fbb6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.2.1 CPython/3.10.5 Darwin/22.1.0

Release files / sendgrid_cli-0.1.4-py3-none-any.whl

Download URL sendgrid_cli-0.1.4-py3-none-any.whl
Size 3.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
235e17597aabc2c4961bf5868b5eef71be73bcb484216e09f679c3e0d01e87e2
BLAKE2b-256 checksum
How to use checksums
589f7a6f29078bc1ccca4c962aeb07b41c932ae1cb81f9a9e7ddc7edfe61c044
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.2.1 CPython/3.10.5 Darwin/22.1.0

Release history Release notifications | RSS feed

This release

0.1.4 This release

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page