Resend provides an api that enable seamless eamil integration on applications
- 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
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.
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!