Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Need little help in setting up contact us page #21

Closed
siddharthdeo99 opened this issue Nov 2, 2021 · 3 comments
Closed

Need little help in setting up contact us page #21

siddharthdeo99 opened this issue Nov 2, 2021 · 3 comments

Comments

@siddharthdeo99
Copy link

How to implement that fetch API for taking input from users and store in the database??

@HamishMW
Copy link
Owner

HamishMW commented Nov 3, 2021

I set up the API for the contact page using a serverless function. You can find the source code for it under functions/index.js. It doesn't store anything in a database, just basically takes the form data and sends it to an email address using Amazon SES. There's a bunch of extra configuration you need to do for Amazon SES, so I'd recommend using Nodemailer and some smtp credentials instead (this is how I had it set up previously, you can see the function using nodemailer in an older commit).

As for hosting the function I'm using AWS lambda, set up with serverless. The config is under functions/serverless.yml. You'll need an AWS account, but once that's set up you can run npm run deploy:api from the /functions directory and it'll automatically set everything up in AWS and spit out a url for the lambda function that you can paste into that fetch request.

@GnaneshNayak
Copy link

hamishMW im not getting serverless function can u please step by step guid or any video

@GnaneshNayak
Copy link

im getting message failed send mail what extra configuration you need to do for Amazon SES,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants