https://github.com/horgh/emailpub
https://github.com/horgh/emailpub
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/horgh/emailpub
- Owner: horgh
- License: gpl-3.0
- Created: 2020-04-11T17:52:17.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2020-04-11T17:52:45.000Z (about 5 years ago)
- Last Synced: 2023-03-11T03:02:28.396Z (about 2 years ago)
- Language: Go
- Size: 1.05 MB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: COPYING
Awesome Lists containing this project
README
# emailpub
emailpub is a Google Cloud Platform Cloud Function. It gets triggered by
messages published to a Pub/Sub topic. Each message represents an email to
send.It sends email via SMTP. The Pub/Sub messages include the subject,
recipient, and text body.I created it because I wanted to send emails from hosts where I don't want
to expose SMTP credentials. With emailpub, I can give these hosts a GCP
service account allowing them to publish messages to send emails.## Setup
Create `env.yml`:
```yaml
---
SMTP_HOST: smtp.gmail.com
SMTP_PORT: '587'
SMTP_USER: [email protected]
SMTP_PASS: password...
```Deploy the function (also creates the Pub/Sub topic):
```
gcloud functions deploy EmailPub \
--runtime go113 \
--trigger-topic emailpub \
--source . \
--env-vars-file env.yml
```