An open API service indexing awesome lists of open source software.

https://github.com/suin/google-cloud-functions-email-router

A Google Cloud Function that routes EmailData
https://github.com/suin/google-cloud-functions-email-router

email-automation google-cloud-function google-cloud-pubsub

Last synced: about 1 year ago
JSON representation

A Google Cloud Function that routes EmailData

Awesome Lists containing this project

README

          

# @suin/google-cloud-functions-email-router

## Setting Up

### Deploying The Stacks To Your GCP

```bash
./deploy.sh
```

## Test Drive

```bash
# Setting up
gcloud pubsub topics create 'test%40example.com'
gcloud pubsub subscriptions create --topic 'test%40example.com' testDrive

# Test
gcloud pubsub topics publish allEmail --message '{"correlationId":"dummy","data":{"to":[{"name":"","address":"test@example.com"}],"cc":[],"replyTo":[],"subject":"Test","from":[]}}'
gcloud pubsub subscriptions pull testDrive \
--format="flattened(ackId,message.messageId,message.publishTime,message.attributes,message.data.decode(base64).encode(utf-8))" \
--limit=10 \
--auto-ack

# Cleaning up
gcloud pubsub subscriptions delete testDrive
gcloud pubsub topics delete 'test%40example.com'
```