mailersend / mailersend-nodejs

The official MailerSend Node.js SDK
https://developers.mailersend.com
MIT License
125 stars 17 forks source link

Problem in TypeScript using NPM package #60

Closed pmtascencao closed 1 year ago

pmtascencao commented 1 year ago

Hey guys,

When using the NPM package, I'm having an error where when I set personalizations like this:

.setPersonalization(personalization)

The error is caused because my object is something like this:

    const personalization = [
      {
        email: 'your@client.com',
        data: {
          name: 'Test Value',
          order: {
            total: '',
            number: '',
            shipping: '',
            subtotal: '',
            createdAt: '',
          },
        },
      },
    ];

And the personalization interface says that data has a string key and a string value: `export interface Personalization { email: string; data: {

};

} `

Can we fix this? Do u want any help?

fosron commented 1 year ago

@pmtascencao You are always free to submit a PR 🙇 Otherwise it will take a little bit of time for our team to fix it.

opheus2 commented 1 year ago

@pmtascencao issue has been resolved, Thank you

pmtascencao commented 1 year ago

@opheus2 Thanks a lot for the quick fix :+1: @fosron next time I'll do a PR instead!