{"id":21359661,"url":"https://github.com/suin/google-cloud-functions-sendgrid-inbound-parse","last_synced_at":"2025-07-13T01:31:25.274Z","repository":{"id":38174160,"uuid":"281849916","full_name":"suin/google-cloud-functions-sendgrid-inbound-parse","owner":"suin","description":"This package is a backend for SendGrid Inbound Parse. It runs on Google Cloud Platform Functions. It receives the form data from SendGrid and publishes an EmailData event to GCP Pub/Sub.","archived":false,"fork":false,"pushed_at":"2023-01-06T12:13:45.000Z","size":3828,"stargazers_count":5,"open_issues_count":24,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-07T03:23:07.448Z","etag":null,"topics":["email-automation","gcp-cloud-functions","google-cloud-platform","google-cloud-pubsub","sendgrid","sendgrid-inbound-webhook-parser","serverless"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/suin.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-07-23T04:26:15.000Z","updated_at":"2024-09-23T10:35:51.000Z","dependencies_parsed_at":"2023-02-06T01:30:56.557Z","dependency_job_id":null,"html_url":"https://github.com/suin/google-cloud-functions-sendgrid-inbound-parse","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/suin/google-cloud-functions-sendgrid-inbound-parse","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/suin%2Fgoogle-cloud-functions-sendgrid-inbound-parse","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/suin%2Fgoogle-cloud-functions-sendgrid-inbound-parse/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/suin%2Fgoogle-cloud-functions-sendgrid-inbound-parse/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/suin%2Fgoogle-cloud-functions-sendgrid-inbound-parse/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/suin","download_url":"https://codeload.github.com/suin/google-cloud-functions-sendgrid-inbound-parse/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/suin%2Fgoogle-cloud-functions-sendgrid-inbound-parse/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265080006,"owners_count":23708098,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["email-automation","gcp-cloud-functions","google-cloud-platform","google-cloud-pubsub","sendgrid","sendgrid-inbound-webhook-parser","serverless"],"created_at":"2024-11-22T05:29:18.902Z","updated_at":"2025-07-13T01:31:25.005Z","avatar_url":"https://github.com/suin.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @suin/google-could-functions-sendgrid-inbound-parse\n\nThis package is a backend for [SendGrid Inbound Parse]. It runs on Google Cloud Platform Functions.\n\n[sendgrid inbound parse]: https://sendgrid.com/docs/for-developers/parsing-email/setting-up-the-inbound-parse-webhook/\n\n## Architecture\n\n![](https://i.imgur.com/vw4CpGm.jpg)\n\n1. The GCP function `publishEmailDataOnSendgridInboundParse` is invoked by SendGrid Inbound Parse.\n2. It parses the form data that was posted by SendGrid.\n3. It transforms the form data into the [EmailData](https://github.com/suin/email-data) object.\n4. It publishes the `EmailData` to GCP Pub/Sub topic `allEmail`.\n\n## Setting Up\n\n### Setting Up The Inbound Parse Webhook\n\nBefore using this package, please read [the SendGrid's official document](https://sendgrid.com/docs/for-developers/parsing-email/setting-up-the-inbound-parse-webhook/) to set up the SendGrid Inbound Parse.\n\n### Deploying The Stacks To Your GCP\n\nThe [deploy.sh](./deploy.sh) a script that deploys this package to your Google Cloud Platform. The script performs these two operations:\n\n1. Create a new Pub/Sub topic to publish the email data which is posted by the SendGrid Inbound Parse Webhook.\n2. Deploy a new function. This function processes the form data which is posted by the SendGrid Inbound Parse Webhook, transforms the form data into an event payload, and publishes the event to the topic which was created by the operation above.\n\nBy default, the topic name is `allEmail`. If you would like to change it, please edit the `deploy.sh`.\n\nTo deploy these stacks, please run the following command:\n\n```bash\n./deploy.sh\n```\n\n### Configuring The SendGrid Inbound Parse\n\nOnce the deployment success, go back to the SendGrid console and add the inbound parse webhook URL.\n\n![](https://i.imgur.com/UMQC40t.png)\n\nAs this function expects raw email data, you have to enable the raw option in the SendGrid console:\n\n## Test Drive\n\nAfter you have finished the setting up above, confirm the system works well.\n\nAt first, to make it possible to receive and read the messages that the function publishes, create a new subscription on the topic:\n\n```bash\ngcloud pubsub subscriptions create --topic allEmail testDrive\n# If you have customized the topic name, please change the `allEmail` above.\n```\n\nAt next, send a test email to the email address which the SendGrid Inbound Parse receives.\n\nThen receive the message using the `testDrive` subscription:\n\n```bash\ngcloud pubsub subscriptions pull testDrive \\\n    --format=\"flattened(ackId,message.messageId,message.publishTime,message.attributes,message.data.decode(base64).encode(utf-8))\" \\\n    --limit=10 \\\n    --auto-ack\n```\n\nIf the system works without any problems, you will see some messages.\n\nFinally, delete the `testDrive` subscription:\n\n```bash\ngcloud pubsub subscriptions delete testDrive\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsuin%2Fgoogle-cloud-functions-sendgrid-inbound-parse","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsuin%2Fgoogle-cloud-functions-sendgrid-inbound-parse","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsuin%2Fgoogle-cloud-functions-sendgrid-inbound-parse/lists"}