mailersend-nodejs icon indicating copy to clipboard operation
mailersend-nodejs copied to clipboard

Change setSettings type from array to object

Open PeterOcansey opened this issue 1 year ago • 0 comments

SetSettings is declared to receive an array of EmailSettings.

image.png

Passing an array or object does not work

const params = new EmailParams()
.setFrom(new Sender('no-reply@youremail', 'YourEmail'))
.setTo([new Recipient(to)])
.setSubject(subject)
.setHtml(html)
.setSettings([{ track_clicks: false, track_opens: false, track_content: false }]);
await this.mailer.email.send(params);

Error

{
"message": "The settings.0 field must be true or false.",
"errors": {
"settings.0": [
"The settings.0 field must be true or false."
]
}

Settings should be an object, let's change the settings params to an Object

PeterOcansey avatar Jun 14 '24 10:06 PeterOcansey