-
Notifications
You must be signed in to change notification settings - Fork 778
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8912bd0
commit c134ecd
Showing
4 changed files
with
54 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Hide Warnings | ||
|
||
When using dynamic templates, if one of the values in the template data contains a single quote, a double quote or an ampersand, a warning will be logged. | ||
|
||
To hide this warning, set `hideWarnings` to `true` in the message. | ||
|
||
```js | ||
const sgMail = require('@sendgrid/mail'); | ||
sgMail.setApiKey(process.env.SENDGRID_API_KEY); | ||
const msg = { | ||
to: '[email protected]', | ||
from: '[email protected]', | ||
templateId: 'd-f43daeeaef504760851f727007e0b5d0', | ||
dynamic_template_data: { | ||
subject: 'Testing Templates', | ||
name: 'Some One', | ||
city: 'Denver', | ||
company: 'Recipient & Sender' | ||
}, | ||
hideWarnings: true // now the warning won't be logged | ||
}; | ||
sgMail.send(msg); | ||
``` |