https://github.com/lordelogos/with-attachments-nextjs
https://github.com/lordelogos/with-attachments-nextjs
Last synced: 5 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/lordelogos/with-attachments-nextjs
- Owner: lordelogos
- Created: 2023-08-19T13:10:56.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2023-08-19T15:25:06.000Z (over 1 year ago)
- Last Synced: 2025-01-08T00:13:55.440Z (4 months ago)
- Language: TypeScript
- Size: 811 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Support: support-questions/assets/with-html.png
Awesome Lists containing this project
README
# Resend with React Email and attachments
This repo contains examples of how to send emails with Resend using React Email and NextJs.
It contains two examples:- [Using Resend with NextJS App Router](/app-router/)
- [Using Resend with NextJS Pages Router](/pages-router/)It also contains answers to some support questions:
- [Support answers](/support-questions/support-answers.md)
## How to run
### 1. Clone the repository
```bash
git clone https://github.com/lordelogos/with-attachments-nextjs.git
```### 2. Select the example you want to view (e.g app-router)
Install the dependencies
```bash
cd app-router
npm run dev
```### 3. Create a `.env` file in the selected project and add your `Resend API key`
```bash
RESEND_API_KEY=re_8m9gwsVG_6n94KaJkJ42Yj6qSeVvLq9xF
```### 4. Update the `from` and `to` fields from the router handler or api route
**Note:** The `to` must be a verified `domain` in your `resend` account. [Read more](https://resend.com/docs/dashboard/domains/introduction)
- For `App-router`, update [route.ts](/app-router/src/app/api/route.ts)
- For `Pages-router`, update [send.ts](/pages-router/src/pages/api/send.ts)### 5. Run the development server
```bash
yarn dev
```### 6. Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
Click the `Send email` button to send an email