This README would normally document whatever steps are necessary to get the application up and running.
Things you may want to cover:
-
Ruby version: 3.1.2.
-
System dependencies: check gemfile demo addons sendgrid-ruby : for mails
-
Configuration: bundle install
-
Database creation: rails db:migrate
-
Database initialization: rails db:migrate
- Create send grid account : https://app.sendgrid.com/
- Get your API key.
- Generate your Mailer class : rails g mailer UserMailer : sample example : use Model + Mailer for naming
- Modify mailer class , check UserMailer in mailer folder
- Set your SMTP / Send Grid configurations : Check configs -> environments (development and production)
- Create a Sendgrid.rb file : check initializers folder , also activate CORS settings at this point
- Modify actions in Controllers : check create in UsersController for example on how to send the mail
- Test on Postman :
Json request for this demo as per user_params
{ "user": { "name": "Production Testing", "email": "[email protected]" } }