chore: add dynamic templates

This commit is contained in:
Muhsin
2025-10-29 23:43:05 +05:30
parent 02a4fc9e54
commit 11fb464501
4 changed files with 60 additions and 7 deletions
@@ -35,7 +35,10 @@ export class TemplateNormalizer {
* @returns {Object} - Normalized template
*/
static normalizeTwilio(template) {
const typeData = template.types?.[`twilio/${template.template_type}`] || {};
// Convert template_type to match the keys used in the types object
const normalizedType = template.template_type.replace('_', '-');
const lookupKey = `twilio/${normalizedType}`;
const typeData = template.types?.[lookupKey] || {};
return {
contentSid: template.content_sid,