Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Added support of replyToList in the library, #339: #1303

Merged

Conversation

subinoy7
Copy link
Contributor

@subinoy7 subinoy7 commented Sep 23, 2021

Fixes #339
Fixes #1301
The replyToList support was added in v3 API but it wasn't supported in the library. With this changes, we can:

  • Use the replyToList header to set multiple emails in the replyTo
  • The replyToList object, must at least have an email parameter and may also contain a name parameter.
  • Fixed old test cases that were failing
  • In test cases, changed the success response code according to new SendGrid standard (link)

Acceptable Format:
[ { "name": "Test Team", "email": "[email protected]" }, { "name": "Support Test Team", "email": "[email protected]" } ]
or
[ { "email": "[email protected]" }, { "name": "Support Test Team", "email": "[email protected]" } ]

packages/helpers/classes/mail.js Outdated Show resolved Hide resolved
packages/mail/src/mail.spec.js Show resolved Hide resolved
packages/helpers/classes/mail.js Outdated Show resolved Hide resolved
packages/mail/src/mail.spec.js Show resolved Hide resolved
packages/mail/src/mail.spec.js Outdated Show resolved Hide resolved
@shwetha-manvinkurke shwetha-manvinkurke changed the title Added support of replyToList in the library, #339: feat: Added support of replyToList in the library, #339: Sep 29, 2021
Subinoy Ghosh and others added 3 commits October 4, 2021 23:06
- removed commented unused code
- Fixed typo in error message string
- added missing test cases
- added example doc of replyToLIst in use-cases
@@ -38,12 +38,12 @@ describe('sgMail.send()', () => {
return expect(sgMail.send()).to.eventually.be.rejectedWith(Error);
});

it('should send a basic email', () => {
sgClient.setDefaultHeader('X-Mock', 201);
it('should send a basic email', async () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't look like async is supported in node 6/8 which we still support

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure, will look into it and do the required changes

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@shwetha-manvinkurke - I removed the use of async in the test case as you suggested

Copy link
Contributor

@shwetha-manvinkurke shwetha-manvinkurke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants