Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Website: Deliver contact form messages to Slack #22231

Merged
merged 1 commit into from
Sep 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 3 additions & 20 deletions website/api/controllers/deliver-contact-form-message.js
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down
Loading