From 42b6444147160cab145adfe535994bc3f97ad16f Mon Sep 17 00:00:00 2001 From: Robbie Averill Date: Mon, 1 Nov 2021 15:23:55 -0700 Subject: [PATCH] Fix undefined variable error --- index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 7e4a5bc..5a8b5b0 100644 --- a/index.js +++ b/index.js @@ -13,9 +13,9 @@ const sendGridClient = require('@sendgrid/client'); * @returns {string} */ function getTemplateId(event, integration) { - const templateId = integration.config.templates[data.event] || ''; + const templateId = integration.config.templates[event] || ''; if (!templateId) { - throw new Error(`Template ID is not available for event: ${data.event}`); + throw new Error(`Template ID is not available for event: ${event}`); } return templateId; }