Built with Ruby on Jets.
The goal with this is to provide a serverless endpoint to submit contact forms on static/serverless websites to. It just takes the email/body and sends to the configured email address.
bundle install
cp .example.env .env.test
cp .example.env .env.development
bundle exec jets server
Contact post
endpoint is at: http://localhost:8888/contact
Example HTML page with form is provided here. You can use it locally to test the form submit.
bundle exec rspec
bundle exec rubocop -a
- SES with your domain and SMTP credentials made
- Route 53 for DNS
- AWS Certificate
Before deploying in production mode, you will need to setup your production env file. See the Custom Domain docs on the Ruby on Jets site for how the domain setup works and CORS Support
cp .example.env.production .env.production
- Replace the env variables with what you need. Note: you can also reference SSM Parameter Store secrets.
DOMAIN=
HOSTED_ZONE_NAME=
CERT_ARN=
are needed for custom domain support.
You will need to have an AWS IAM Profile setup. If it's not the default profile, you will need to prefix the deploy command with AWS_PROFILE=other
.
JETS_ENV=production bundle exec jets deploy
Once deployed, it should create the subdomain and associate it with the API Gateway. From there, you can post /submit
to it.