nylas / nylas-nodejs

A NodeJS wrapper for the Nylas REST API for email, contacts, and calendar.
MIT License
166 stars 116 forks source link

Nylas v3 - Sending Email - "FormData is not a constructor" #527

Closed birksy89 closed 6 months ago

birksy89 commented 6 months ago

Describe the bug When trying to use await nylas.messages.send(), an error of "FormData is not a constructor" is thrown

To Reproduce

const sendMessage = await nylas.messages.send({
        identifier: input.grantId,
        requestBody: {
          to: to,
          subject: subject,
          body: body,
          replyToMessageId: replyToMessageId,
          threadId: threadId,
        },
      });

Expected behavior The email should be sent - It has done previously.

SDK Version: "nylas": "^7.0.0-beta.3"

Additional context Sending via a cURL request works.

I think the issue is around here: node_modules\nylas\lib\esm\resources\messages.js Line 101

EDIT: @mrashed-dev - I wonder if you've already fixed this here: https://github.com/nylas/nylas-nodejs/pull/523

And I'm just not able to access the 7.0.0-beta.4 yet.

mrashed-dev commented 6 months ago

@birksy89 the release is out for beta 4! https://www.npmjs.com/package/nylas/v/7.0.0-beta.4