Open escobarjj opened 4 years ago
This functionality is not currently built into the library. You could do something like get the template body, and parse the unique occurences of your {{handlebar_tags}}
and make sure you have an entry for each one before sending the email. Pull requests to add this feature are welcome and will be reviewed based on priority, but Twilio SendGrid is not actively building new functionality for the library.
Going to look into this one
Would the idea of this be something like adding an additional method that would get only the substitution tags that are inside a template, and leave out any substitution tags that are not in a template?
I'm thinking a method that GET
s the template and returns a set of all the substitution tags found in the template. Users can then use this set to determine if they've populated them all in the mail-send request.
Sounds like that approach would be through _GET /templates/{templateid}. Would we want to support _GET /mailsettings/template by chance?
I think not, given that it's a legacy feature, but I'm not totally against it. Could make it an option for the new method.
Hi! Is there a way to get all the substitution tags in a specific template?
I want to make sure I am sending all the required information for my template before sending emails.
Thanks!