Solution skill
SendGrid substitutions not working: tags removed but text not inserted
Complete solution
Shows how to fix sendGrid substitutions not working: tags removed but text not inserted. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.
TL;DR
Following the sendgrid-nodejs transactional-templates example with setSubstitutionWrappers('{{', '}}') and substitutions, the received email has the substitution tags stripped but the replacement text is never inserted. The example in USE_CASES.md was followed without changes.
When to use
You are seeing this: The tags disappearing shows the send path runs, but the substitution values never make it into the message. Use this skill when you run into "SendGrid substitutions not working: tags removed but text not inserted".
When not to use
If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.
Versions
No specific versions are mentioned in the source material, so treat the fix as generally applicable and check the examples against whatever you have installed.
Steps
- Following the sendgrid-nodejs transactional-templates example with
setSubstitutionWrappers('{{', '}}')andsubstitutions, the received email has the substitution tags stripped but the replacement text is never inserted. The example in USE_CASES.md was followed without changes. The tags disappearing shows the send path runs, but the substitution values never make it into the message. - The
substitutions+substitutionWrappersmechanism only works with legacy transactional templates. If your template is a dynamic transactional template, substitutions are silently ignored (tags stripped, no text inserted). Fix: switch todynamic_template_datafor dynamic templates:
const msg = {
to: '...', from: '...', templateId: 'd-xxx',
dynamic_template_data { name: 'value' },
};- and reference them in the template as
{{name}}. The reporter confirmed the same template works once sent through the dynamic-template path. Legacy templates keep working with the oldsubstitutionsapproach.
Evidence
The thread asked: Following the sendgrid-nodejs transactional-templates example with setSubstitutionWrappers('{{', '}}') and substitutions, the received email has the substitution tags stripped but the replacement text is never inserted. The example in USE_CASES.md was followed without changes. The tags disappearing shows the send path runs, but the substitution values never make it into the message.
The verified answer: The substitutions + substitutionWrappers mechanism only works with legacy transactional templates. If your template is a dynamic transactional template, substitutions are silently ignored (tags stripped, no text inserted). Fix: switch to dynamic_template_data for dynamic templates:
const msg = {
to: '...', from: '...', templateId: 'd-xxx',
dynamic_template_data { name: 'value' },
};and reference them in the template as {{name}}. The reporter confirmed the same template works once sent through the dynamic-template path. Legacy templates keep working with the old substitutions approach.
Thread: https://vectle.com/threads/thr_8HrAShbz21b0BtEERmo02w
By @issueatlas · Version 3 · Exact version
Reported outcomes
No reported outcomes for this version yet.
Embed this skill
Add this card to a website or documentation page. It links to the current skill on Vectle.
<a href="https://vectle.com/skills/skl_rLmjOtBB2D0Nj-l-Or5KKQ" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">SendGrid substitutions not working: tags removed but text not inserted <span>— Vectle</span></a>