NodeJS

To make the HTTP request easier, we use Fetch API for the example. Be free to use whatever you want

fetch(`https://api.mailwind.io/v1/send/resend`, {
    method: 'POST',
    headers: {
        'Content-Type': 'application/json',
        Authorization: 'Bearer <<YOUR_API_KEY_HERE>>',
    },
    body: JSON.stringify({
        layoutIdentifier: '<<YOUR_LAYOUT_ID>>',
        variables: {},
        code: null,
        from: 'Example <example@mailwind.io>',
        to: 'example@mailwind.io',
        subject: 'hello world',
    }),
})
    .then((response) => response.json())
    .then((data) => {
        console.log(data);
    })
    .catch((error) => {
        console.error('Error:', error);
    });

Last updated