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/ses`, {
    method: 'POST',
    headers: {
        'Content-Type': 'application/json',
    },
    body: JSON.stringify({
        accessKey: '<<YOUR_ACCESS_KEY>>',
        secretKey: '<<YOUR_SECRET_KEY>>',
        region: '<<YOUR_AWS_REGION>>', // eg. us-east-1
        layoutIdentifier: '<<YOUR_API_KEY_HERE>>',
        variables: {},
        code: null,
        source: 'example.mailwind.io',
        destination: {
            toAddresses: ['example.mailwind.io'],
        },
        message: {
            subject: {
                data: '[Your Subject Here]',
            },
        },
    }),
})
    .then((response) => response.json())
    .then((data) => {
        console.log(data);
    })
    .catch((error) => {
        console.error('Error:', error);
    });

Last updated