{"id":26403099,"url":"https://github.com/davidtaing/vercel-send-email","last_synced_at":"2026-04-24T20:36:49.407Z","repository":{"id":90777374,"uuid":"606643356","full_name":"davidtaing/vercel-send-email","owner":"davidtaing","description":"Programmatically send emails using the SendGrid API and Vercel Serverless Functions","archived":false,"fork":false,"pushed_at":"2023-02-26T11:12:15.000Z","size":118,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-06-11T10:13:10.680Z","etag":null,"topics":["nodejs","sendgrid","serverless-functions","typescript","vercel-serverless-functions"],"latest_commit_sha":null,"homepage":"https://vercel-send-email.vercel.app","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/davidtaing.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-02-26T05:17:33.000Z","updated_at":"2023-02-26T11:35:39.000Z","dependencies_parsed_at":null,"dependency_job_id":"73619371-7e71-4047-9205-f200c3072c75","html_url":"https://github.com/davidtaing/vercel-send-email","commit_stats":null,"previous_names":[],"tags_count":0,"template":true,"template_full_name":null,"purl":"pkg:github/davidtaing/vercel-send-email","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidtaing%2Fvercel-send-email","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidtaing%2Fvercel-send-email/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidtaing%2Fvercel-send-email/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidtaing%2Fvercel-send-email/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/davidtaing","download_url":"https://codeload.github.com/davidtaing/vercel-send-email/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidtaing%2Fvercel-send-email/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32240226,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-24T13:21:15.438Z","status":"ssl_error","status_checked_at":"2026-04-24T13:21:15.005Z","response_time":64,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["nodejs","sendgrid","serverless-functions","typescript","vercel-serverless-functions"],"created_at":"2025-03-17T15:29:47.117Z","updated_at":"2026-04-24T20:36:49.402Z","avatar_url":"https://github.com/davidtaing.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Vercel Send Email\n\nSend emails using the SendGrid API on a Vercel Serverless Function.\n\n\n## Background\n\nAt Code.Sydney, I mentor beginner programmers and help them build the skills that they need to get a job in Software.\n\nOne of our mentees was trying to implement a `Contact Me` form where an email would be sent to himself when the form is submitted. \n\nImplementing a backend would be fairly difficult for someone who has just started learning HTML, CSS and JS. So I built this project to allow beginners to programmatically send emails without having to build a backend.\n\n\n# Using the Serverless Function\n\nTODO\n\n# Setup\n\n## Setting Up the Repository\n\nTo get started click on the green `Use this template` button to create a new repository under your account.\n\n\n## Environment Variables\n\nBefore we get into the setup instructions, here is a quick overview of the Enviornment Variables for this project. Environment Variable are used to pass in sensitive configuration settings to an application.\n\n- `SECRET_KEY` - this will be used to authorize requests. A strong key can be generated using `openssl rand -base64 32`\n- `SENDGRID_API_KEY` - used to authorize requests to the SendGrid API\n- `SEND_TO_EMAIL` - this is where you want to send your emails.\n- `SEND_FROM_EMAIL` - sender identity\n\n\n**Local Environment Variables**\n\nI've left an [`.env.example`](https://github.com/davidtaing/vercel-send-email/blob/main/.env.example) file in the root directory in case you need to run this project locally. Copy and paste the file with the name `.env`.\n\n**Note: Any changes to the `.env.example` file will be checked into Git. Be careful that you don't check-in any secrets such as API keys.**\n\nWe'll use the `.env` file to temporarily hold onto our secrets from the following steps.\n\n\n# Setup - Video Guide\n\nTODO: to be recorded at a later date.\n\n\n# Setup - Text Guide\n\nThis template requires accounts with Vercel and SendGrid.\n\n\n## Create a Vercel Account\nhttps://vercel.com/signup\n\nThis one is rather straightforward. Since we'll need to connect our GitHub project to Vercel, I'll recommend creating an account using your GitHub login.\n\n\n## Setup a SendGrid Account - Free Tier Allows 100 Emails Per Day\n\n`Create an Account` -\u003e `Create a Sender Identity` -\u003e `Create an API Key`\n\n### Create an Account\nhttps://signup.sendgrid.com/\n\n\n### Create a Sender Identity\nhttps://app.sendgrid.com/settings/sender_auth/senders/new\n\nYour sender identity is the “from” email address your recipients see in their inbox. \n\nNote: SendGrid will throw an error if you use an email that is not setup as a sender identity.\n\n\n### Create an API Key\nhttps://app.sendgrid.com/settings/api_keys\n\nThis key will be used to authorize requests to the SendGrid API.\n\nI'll recommend setting the key access to only Email Send.\n\n[Email send access settings](https://user-images.githubusercontent.com/8443215/221404298-c2720e7b-056d-40e5-b484-7ae2645f2297.png)\n\n\n## Deploying the Project to Vercel\n\n`Login to Vercel` -\u003e `New Project Button` -\u003e `Import Gihub Repository` -\u003e `Deploy`\n\n- Login to Vercel and navigate to your Vercel Dashboard.\n- [New Project Button](https://user-images.githubusercontent.com/8443215/221405846-d06c97c1-079d-4b3a-b15f-0ea6ac7b64c6.png)\n- [Import Gihub Repository](https://user-images.githubusercontent.com/8443215/221405909-301d9a65-2de6-4914-840f-dafc08b2a9af.png) \n- [Deploy](https://user-images.githubusercontent.com/8443215/221405924-18d50492-455a-4cbc-887d-7cd8b9d2f5ea.png)\n\n\n## Setting up the Environment Variables on Your Vercel Deployment\nRelevant Docs: https://vercel.com/docs/concepts/projects/environment-variables#\n\nOkay, now want to add our environment variables to our Vercel project. \n\nNavigate to the Environment Variables menu and copy and paste in your Enviroment Variables from the `.env` file. Alternatively, you could enter them one by one.\n\n`Select Project` -\u003e `Settings` -\u003e `Environment Variables`\n\n- [Selecting Project from Dashboard](https://user-images.githubusercontent.com/8443215/221405967-3f3fe9a9-917d-4580-93db-c4d18711976f.png)\n- [Settings](https://user-images.githubusercontent.com/8443215/221405974-7f615bde-e5a6-45ef-8ac8-e5430b741f37.png)\n- [Environment Variables](https://user-images.githubusercontent.com/8443215/221405991-f983ce13-99b3-48dd-a78f-2d49f4a765ef.png)\n- [Filled-In Environment Variables Menu](https://user-images.githubusercontent.com/8443215/221406063-669b6b4d-a4a6-4e7a-9c05-e8ebee878ca9.png)\n\n## Redeploying Your Vercel Deployment\n\nOkay, nearly there! The environment variables haven't been loaded into our deployment yet. Let's redeploy the Vercel project to update the changes.\n\n`Select Project` -\u003e `Deployments` -\u003e `Deployment Dropdown Menu` -\u003e `Redeploy`\n\n[Redeploy Step](https://user-images.githubusercontent.com/8443215/221406085-1f8e5641-4861-402d-9aec-6db10e66954e.png)\n\n# 🎉🎉🎉 Now we're done! We can now use the Serverless function to send emails.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavidtaing%2Fvercel-send-email","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdavidtaing%2Fvercel-send-email","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavidtaing%2Fvercel-send-email/lists"}