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.
This commit is contained in:
Eric 2024-09-19 09:09:21 -05:00 committed by GitHub
parent 9a1b3769c8
commit ebb62af6d9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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({