Sign inSign up

weaponsforge/sendemail

By weaponsforge

Updated about 1 month ago

NPM scripts for sending text and HTML emails using Gmail SMTP with Google OAuth2

Image
Developer tools
0

2.2K

weaponsforge/sendemail repository overview

send-email

Features an NPM CLI for sending text and HTML emails using Gmail SMTP with Google OAuth2.

GitHub Repository
https://github.com/weaponsforge/send-email

NPM Registry (Library)
https://www.npmjs.com/package/@weaponsforge/sendemail

Requirements

  1. Google Cloud Platform project

Installation

  1. Pull the "latest" production image.
    docker pull weaponsforge/sendemail

  2. Create a .env file containing the following:

    Variable NameDescription
    GOOGLE_USER_EMAILYour Google email that you've configured for Gmail SMTP and Google OAuth2.
    GOOGLE_CLIENT_IDGoogle OAuth2 client ID linked with your Google Cloud Platform project.
    GOOGLE_CLIENT_SECRETGoogle OAuth2 client secret associated with the GOOGLE_CLIENT_ID.
    GOOGLE_REFRESH_TOKENThe initial (or any) refresh token obtained from the OAuthPlayground

Usage

  1. Send a text email using the CLI, eg. using Bash:

    docker run -it --env-file ./path/to/.env --rm weaponsforge/sendemail npm start -- text \
      -s "You are Invited" \
      -c "Birthday party in December" \
      -r [email protected],[email protected],[email protected]
    
  2. Send a styled HTML email using the CLI, eg. using Bash:

    docker run -it --env-file ./path/to/.env --rm weaponsforge/sendemail npm start -- html \
      -s "Reading Materials" \
      -c "Lorem ipsum dolor sit amet" "this is paragraph 1" "this is paragraph 2" \
      -r [email protected],[email protected],[email protected]
    
  3. Send a WYSIWYG HTML content using the CLI, eg. using Bash:

    docker run -it --env-file ./path/to/.env --rm weaponsforge/sendemail npm start -- html \
      -s "WYSIWYG Email" \
      -w "<div style='width:100px; height:100px; border:5px solid blue; border-radius: 3px; padding: 8px; text-align: center; background-color: azure;'><h3>Hello, World</h3></div>" \
      -r "[email protected]"
    

Tag summary

Content type

Image

Digest

sha256:e1095f014

Size

60.2 MB

Last updated

about 1 month ago

docker pull weaponsforge/sendemail