NPM scripts for sending text and HTML emails using Gmail SMTP with Google OAuth2
2.2K
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
Pull the "latest" production image.
docker pull weaponsforge/sendemail
Create a .env file containing the following:
| Variable Name | Description |
|---|---|
| GOOGLE_USER_EMAIL | Your Google email that you've configured for Gmail SMTP and Google OAuth2. |
| GOOGLE_CLIENT_ID | Google OAuth2 client ID linked with your Google Cloud Platform project. |
| GOOGLE_CLIENT_SECRET | Google OAuth2 client secret associated with the GOOGLE_CLIENT_ID. |
| GOOGLE_REFRESH_TOKEN | The initial (or any) refresh token obtained from the OAuthPlayground |
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]
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]
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]"
Content type
Image
Digest
sha256:e1095f014…
Size
60.2 MB
Last updated
about 1 month ago
docker pull weaponsforge/sendemail