const MAILRIFY_API_KEY = 'YOUR_API_KEY';
export const handler = async(event) => {
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 {
statusCode: 200,
body: data,
};
}
};