mailjet / mailjet-apiv3-nodejs

[API v3] Official Mailjet API v3 NodeJS wrapper
https://dev.mailjet.com
MIT License
235 stars 69 forks source link

disable-api-call does not disable sending emails #210

Closed rafipiccolo closed 2 years ago

rafipiccolo commented 2 years ago

emails are not disabled when following this : https://github.com/mailjet/mailjet-apiv3-nodejs#disable-api-call

i have received an email using this.


import Mailjet from 'node-mailjet';
const mailjet = Mailjet.apiConnect(
    process.env.TEST_MAILJET_USER,
    process.env.TEST_MAILJET_PASSWORD,
);
try {
    const result = await mailjet.post('send', { version: 'v3.1' }).request({
        Messages: [
            {
                From: {
                    Email: process.env.TEST_MAILJET_FROMEMAIL,
                    Name: process.env.TEST_MAILJET_FROMNAME
                },
                To: [
                    {
                        Email: process.env.TEST_MAILJET_TOEMAIL,
                        Name: process.env.TEST_MAILJET_TONAME
                    }
                ],
                Subject: "Your email flight plan!",
                TextPart: "Dear passenger 1, welcome to Mailjet! May the delivery force be with you!",
                HTMLPart: "<h3>Dear passenger 1, welcome to <a href=\"https://www.mailjet.com/\">Mailjet</a>!</h3><br />May the delivery force be with you!"
            }
        ]
    }, {}, false)

    console.log(result.body)
} catch(err) {
    console.log(err.statusCode)
}
rafipiccolo commented 2 years ago

my bad, i wasn't using latest version. (v5)