{"id":21917541,"url":"https://github.com/chrismwilliams/static-form-lambda","last_synced_at":"2025-07-21T20:30:57.689Z","repository":{"id":52274033,"uuid":"137862671","full_name":"chrismwilliams/static-form-lambda","owner":"chrismwilliams","description":"Serverless template, creating a FaaS aws lambda to handle form submissions","archived":true,"fork":false,"pushed_at":"2022-08-03T12:57:15.000Z","size":42,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-22T09:46:37.352Z","etag":null,"topics":["amazon-web-services","contact-form","email","faas","lambda-functions","nodejs","sendgrid","serverless","static-site"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/chrismwilliams.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}},"created_at":"2018-06-19T08:29:34.000Z","updated_at":"2023-06-05T07:08:42.000Z","dependencies_parsed_at":"2022-09-06T20:31:52.734Z","dependency_job_id":null,"html_url":"https://github.com/chrismwilliams/static-form-lambda","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/chrismwilliams/static-form-lambda","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrismwilliams%2Fstatic-form-lambda","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrismwilliams%2Fstatic-form-lambda/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrismwilliams%2Fstatic-form-lambda/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrismwilliams%2Fstatic-form-lambda/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chrismwilliams","download_url":"https://codeload.github.com/chrismwilliams/static-form-lambda/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrismwilliams%2Fstatic-form-lambda/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266374953,"owners_count":23919496,"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","status":"online","status_checked_at":"2025-07-21T11:47:31.412Z","response_time":64,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"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":["amazon-web-services","contact-form","email","faas","lambda-functions","nodejs","sendgrid","serverless","static-site"],"created_at":"2024-11-28T19:34:00.796Z","updated_at":"2025-07-21T20:30:57.344Z","avatar_url":"https://github.com/chrismwilliams.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AWS Lambda For A Static Contact Form 📬\n\nA simple AWS Lambda serverless template creating an api to post your form data to, which can then be emailed to your preferred address. Ideal for a contact form on a static website\n\n## Uses: Amazon Web Service, Serverless \u0026 SendGrid\n\n## Requirements:\n\n- An [AWS](https://aws.amazon.com/) Account\n- Install serverless cli: `npm install -g serverless`\n  - Add your AWS credentials to [serverless](https://serverless.com/framework/docs/providers/aws/guide/credentials/)\n- A [SendGrid](https://sendgrid.com/) Account\n  - An api [key](https://app.sendgrid.com/settings/api_keys), (_keep this handy as by default you have to add it to AWS after deploying_)\n  - (Optional) A configured template and resulting template ID to template your emails\n- Download this repository\n  - Install dependencies: `yarn install` / `npm install`\n  - Rename sample.env to .env and add your SendGrid API key\n  - (Optional) Update the serverless.yml region to your preference, defaults to London.\n- Open up handler.js and update the mailOptions object to your preference\n- After deploying via the serverless command, add your SendGrid API_KEY to the lambda environment\n\n## Terminal Commands:\n\n```bash\n$ serverless deploy -v\n# This pushes the whole thing to AWS, creating your personal endpoint to post your form data to\n# You can now view the lambda (aws \u003e Lambda \u003e Functions) and add your SendGrid API_KEY to the environment\n\n$ serverless deploy function -f contact\n# Made changes to just the handler.js file?\n# Instead of deploying the whole thing again which can take a while, this just updates the Lambda.\n\n$ serverless offline start\n# This command will spin up a local server that allows you to test your function locally.\n```\n\n## Form Example\n\n```html\n\u003c!--\n  Simple form example, remember to add your form action route,\n  either AWS or localhost\n--\u003e\n\u003cform action=\"URL_HERE\" method=\"post\"\u003e\n  \u003clabel for=\"name\"\u003eName\u003c/label\u003e\n  \u003cinput type=\"text\" name=\"name\" id=\"name\"\u003e\n  \u003c!-- Following input could easily be changed to a reCAPTCHA--\u003e\n  \u003clabel for=\"honeypot\"\u003ePlease don't fill this in\u003c/label\u003e\n  \u003cinput type=\"hidden\" name=\"honeypot\" autocomplete=\"off\"\u003e\n  \u003c!-- --\u003e\n  \u003clabel for=\"reply_to\"\u003eEmail\u003c/label\u003e\n  \u003cinput type=\"email\" name=\"reply_to\" id=\"reply_to\"\u003e\n  \u003clabel for=\"message\"\u003eYour Message\u003c/label\u003e\n  \u003ctextarea name=\"message\" id=\"message\"\u003e\u003c/textarea\u003e\n  \u003cinput type=\"submit\" value=\"Submit\"\u003e\n\u003c/form\u003e\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchrismwilliams%2Fstatic-form-lambda","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchrismwilliams%2Fstatic-form-lambda","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchrismwilliams%2Fstatic-form-lambda/lists"}