From ebb62af6d99c41c92fbeb2f6b3375466a766ba56 Mon Sep 17 00:00:00 2001 From: Eric Date: Thu, 19 Sep 2024 09:09:21 -0500 Subject: [PATCH] Website: Deliver contact form messages to Slack (#22231) Related to: https://github.com/fleetdm/confidential/issues/8098 Changes: - Updated `deliver-contact-form-message` to send contact form submissions to a Slack webhook. --- .../deliver-contact-form-message.js | 23 +++---------------- 1 file changed, 3 insertions(+), 20 deletions(-) diff --git a/website/api/controllers/deliver-contact-form-message.js b/website/api/controllers/deliver-contact-form-message.js index ea5d6251ec..37e5693f5c 100644 --- a/website/api/controllers/deliver-contact-form-message.js +++ b/website/api/controllers/deliver-contact-form-message.js @@ -66,26 +66,9 @@ module.exports = { throw 'invalidEmailDomain'; } - // await sails.helpers.http.post(sails.config.custom.slackWebhookUrlForContactForm, { - // text: `New contact form message: (Remember: we have to email back; can't just reply to this thread.) cc @sales `+ - // `Name: ${firstName + ' ' + lastName}, Email: ${emailAddress}, Message: ${message ? message : 'No message.'}` - // }); - - await sails.helpers.sendTemplateEmail.with({ - to: sails.config.custom.fromEmailAddress, - replyTo: { - name: firstName + ' '+ lastName, - emailAddress: emailAddress, - }, - subject: 'New contact form message', - layout: false, - template: 'email-contact-form', - templateData: { - emailAddress, - firstName, - lastName, - message, - }, + await sails.helpers.http.post(sails.config.custom.slackWebhookUrlForContactForm, { + text: `New contact form message: (Remember: we have to email back; can't just reply to this thread.)`+ + `Name: ${firstName + ' ' + lastName}, Email: ${emailAddress}, Message: ${message ? message : 'No message.'}` }); sails.helpers.salesforce.updateOrCreateContactAndAccount.with({