Skip to content

Unrealrojo234/TechItEmailServer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Resend API using express js

Resend provides an api that enable seamless eamil integration on applications

Running it locally

Prerequisities

  • Have nodejs installed
  • Create a resend account on their website

Clone this repo using git:

git clone "https://github.com/Unrealrojo234/ResendAPI"

Install the dependencies using npm

npm install

Make an .env file to hold your environment variabless.

API_KEY="<Your api key generated from resend>"
RECEPIENT_EMAIL="email address to receive the mail"

Generate an api key from intasend and assign it to the API_KEY variable.

Don't forget to add an email address to the RECIPIENT_EMAIL variable

Starting the server:

npm run dev

The server will be running on port 3000

Open your browser and search for http://localhost:3000/, this is your root domain and to send an email, you will have to add params to this domain.

Example

http://localhost:3000/send/your_email/message/your_name since this is the format that our params follow

Code snippet.

app.get("/send/:email/:msg/:name", async (req, res) => {
  const { email, msg, name } = req.params;
}

Happy coding!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published