api-email-sendgrid

Api to send email through of service the Sendgrid

MIT License

Stars
0

Api Email Sendgrid

Api to send email through of service the Sendgrid

Starter

Install all the dependencies.

yarn install

Create file .env with the keys they are in the template.

copy template.env .env

Add the environment variables.

  • create a SERVER_API_KEY executing the command
yarn create-apikey
  • create a SENDGRID_API_KEY logging into your sendgrid account, which must have the following format: SG.aaaaaaaaaaaaaa.bbbbbbbbbbbbbbbbbbbbbbbb

  • create a RECAPTCHA_API_KEY using google service Recaptcha.

Start api in mode development.

yarn dev

Commands List

yarn lint # linting to files .ts with Prettier
yarn create-apikey # create api key
yarn dev # run api in mode development
yarn prod # run api in mode production

Command to Deploy in Server

yarn build # build api
yarn start # run api builded

Endpoints List

Endpoint HTTP Description Status
/api GET Send a email from interface IN PROGRESS
/status GET Check api status OK
/api/recaptcha_verify POST Verify captcha of Google OK
/api/send_email POST Send a email OK

Request Example