Giter Club home page Giter Club logo

socketlabs-nodejs's People

Contributors

bernardharrison avatar david-schrenker avatar dependabot[bot] avatar mattreibach avatar mboshu avatar mirriamronoh avatar saranyakavuri48 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

socketlabs-nodejs's Issues

Unable to validate replyTo field without using the EmailAddress class

From the documentation examples:

//Many different ways to add recipients
message.to.push("[email protected]");
message.to.push(new EmailAddress("[email protected]"));
message.to.push(new EmailAddress("[email protected]", { friendlyName: "Recipient #3" }));
message.to.push({ emailAddress: "[email protected]" });
message.to.push({ emailAddress: "[email protected]", friendlyName: "Recipient #5" });

i understand that for every email i have these many options to use, but for the given case of the replyTo field if i try to use the object definition directly:
replyTo: { emailAddress: data.replyTo.emailAddress }

it throws the following error:

2022-05-27T09:48:39.363Z	bee95426-8d19-5c27-b788-0f2c2db3636d	ERROR	Invoke Error 	{"errorType":"TypeError","errorMessage":"this.replyTo.toJSON is not a function","stack":["TypeError: this.replyTo.toJSON is not a function","    at e.exports.toJSON (/var/task/src/main/js/index.js:2:18636)","    at /var/task/src/main/js/index.js:2:3417","    at new Promise (<anonymous>)","    at Object.generateRequest (/var/task/src/main/js/index.js:2:2703)","    at /var/task/src/main/js/index.js:2:34672","    at new Promise (<anonymous>)","    at SocketLabsClient.send (/var/task/src/main/js/index.js:2:34552)","    at /var/task/src/main/js/index.js:2:473415","    at processTicksAndRejections (internal/process/task_queues.js:95:5)","    at async Runtime.e.exports.handler (/var/task/src/main/js/index.js:2:471749)"]}

I had to import the EmailAddress class to avoid the error. I believe since the documentation states that the declaration can be done differently there's something to be addressed.

Thanks

PD: i have other emails in the message other than the replyTo declared the same way and they work properly.

toAttachment.convert(element).toJSON()

Hi,
according to the code
toAttachment.convert should return an attachment instance with "toJSON" function, however we got only the second object and it failed on toJSON call, you can see the example below:
line 50 in file toAttachment.js

return new attachment(), {
                name: n,
                content: c,
                contentType: t,
                customHeaders: h,
                filePath: f,
                contentId: i
            };

so if we will change the code to run the constructor properly it works like it should be:

return new attachment( {
                name: n,
                content: c,
                contentType: t,
                customHeaders: h,
                filePath: f,
                contentId: i
            });

Thank you,
Moria

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.