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

Disable dynamic template char warning #931

Closed
alberto-fp-24 opened this issue May 15, 2019 · 7 comments
Closed

Disable dynamic template char warning #931

alberto-fp-24 opened this issue May 15, 2019 · 7 comments
Labels
difficulty: medium fix is medium in difficulty type: community enhancement feature request not on Twilio's roadmap

Comments

@alberto-fp-24
Copy link

alberto-fp-24 commented May 15, 2019

Currently, when passing dynamicTemplateData that contains a quote or an ampersand, I am warned that I may need to use three brackets on the template.

Object.values(dynamicTemplateData).forEach(value => {
      if (/['"&]/.test(value)) {
        console.warn(DYNAMIC_TEMPLATE_CHAR_WARNING);
      }
    });

While it was originally very helpful, now it is cluttering my logs. Is there any way to disable this warning (other than overwriting console.warn)?

@thinkingserious thinkingserious added difficulty: easy fix is easy in difficulty help wanted status: help wanted requesting help from the community type: community enhancement feature request not on Twilio's roadmap labels May 16, 2019
@thinkingserious
Copy link
Contributor

Hello @alberto-fp-24,

Good call, I've added this to our backlog and also tagged it appropriately in case someone in our Node.js community would like to make a PR.

With Best Regards,

Elmer

@albertor24
Copy link
Contributor

@thinkingserious thank you very much.

I created a PR for this #932

@vieira
Copy link

vieira commented May 20, 2019

Hello, we are also having this problem since updating sendgrid/helpers from 6.3.0 to 6.4.0. We are using {{{ }}} but the warning is still logged. Is this the intended behaviour?

@thinkingserious thinkingserious added difficulty: medium fix is medium in difficulty status: ready for deploy code ready to be released in next deploy and removed difficulty: easy fix is easy in difficulty help wanted status: help wanted requesting help from the community labels May 20, 2019
@thinkingserious
Copy link
Contributor

Hello @vieira,

For now this is intended behavior; however, @albertor24 PR #932 gives you the option to hide that warning. It will be included in the next release of this SDK.

Thanks!

With Best Regards,

Elmer

@ErwinAI
Copy link

ErwinAI commented Aug 13, 2019

#965 is a duplicate of this issue.
@thinkingserious It seems that this PR hasn't made it into a release yet. It has been over three months now though. Is there any news on this?

@childish-sambino
Copy link
Contributor

Fixed by #932 which was included in the 6.5.0 release.

@srinivas1186
Copy link

In sgMail.send function data parameter add hideWarnings : true value to suppress the warnings

@childish-sambino childish-sambino removed the status: ready for deploy code ready to be released in next deploy label Aug 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
difficulty: medium fix is medium in difficulty type: community enhancement feature request not on Twilio's roadmap
Projects
None yet
Development

No branches or pull requests

7 participants