const MAILRIFY_API_KEY = 'YOUR_API_KEY';
export async function POST() {
const res = await fetch('https://app.mailrify.com/api/v1/emails', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
Authorization: `Bearer ${MAILRIFY_API_KEY}`,
},
body: JSON.stringify({
from: 'Your app <[email protected]>',
to: '[email protected]',
subject: 'Welcome to Mailrify ๐',
html: '<p>It works! ๐</p>',
text: 'It works!'
})
});
if (res.ok) {
const data = await res.json();
return Response.json(data);
}
}