Skip to content

How does sending emails from the development preview server work? #1956

Closed Answered by gabrielmfern
dy0gu asked this question in Q&A
Discussion options

You must be logged in to vote

We host an API for this ourselves and call it here

const response = await fetch('https://react.email/api/send/test', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
to,
subject,
html: markup,
}),
});

the code for that endpoint is

export async function POST(req: NextRequest) {
const resend = new Resend(process.env.RESEND_API_KEY);

Replies: 3 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@dy0gu
Comment options

Answer selected by gabrielmfern
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants