mirror of
https://github.com/fleetdm/fleet
synced 2026-05-23 00:49:03 +00:00
Website: Deliver contact form messages via email. (#29455)
Closes: https://github.com/fleetdm/confidential/issues/10750 Changes: - Added a new config variable: `contactFormEmailAddress` - updated deliver-contact-form-message to send emails to users who do not have a Fleet Premium subscription.
This commit is contained in:
parent
83c29d2cc5
commit
0eb3bbd3e0
1 changed files with 18 additions and 1 deletions
|
|
@ -66,7 +66,7 @@ module.exports = {
|
|||
`Name: ${firstName + ' ' + lastName}, Email: ${emailAddress}, Message: ${message ? message : 'No message.'}`
|
||||
);
|
||||
}
|
||||
if(userHasPremiumSubscription){
|
||||
if(userHasPremiumSubscription) {
|
||||
// If the user has a Fleet Premium subscription, prepend the message with details about their subscription.
|
||||
let subscriptionDetails =`
|
||||
Fleet Premium subscription details:
|
||||
|
|
@ -94,6 +94,23 @@ Fleet Premium subscription details:
|
|||
message,
|
||||
},
|
||||
});
|
||||
} else {
|
||||
await sails.helpers.sendTemplateEmail.with({
|
||||
to: sails.config.custom.contactFormEmailAddress,
|
||||
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, {
|
||||
|
|
|
|||
Loading…
Reference in a new issue