mirror of
https://github.com/fleetdm/fleet
synced 2026-05-06 14:58:33 +00:00
Changes: - Updated the contact page to only display the "Send a message" form for users who have a Fleet premium subscription - Updated the deliver-contact-form-message action to include details about a user's subscription if the user has purchased a Fleet premium license, and to also send an email to our support email address (in addition to sending a message to our Slack)
53 lines
966 B
JavaScript
Vendored
53 lines
966 B
JavaScript
Vendored
module.exports = {
|
|
|
|
|
|
friendlyName: 'View contact',
|
|
|
|
|
|
description: 'Display "Contact" page.',
|
|
|
|
inputs: {
|
|
sendMessage: {
|
|
type: 'boolean',
|
|
description: 'A boolean that determines whether or not to display the talk to us form when the contact page loads.',
|
|
defaultsTo: false,
|
|
},
|
|
},
|
|
|
|
exits: {
|
|
|
|
success: {
|
|
viewTemplatePath: 'pages/contact'
|
|
}
|
|
|
|
},
|
|
|
|
|
|
fn: async function ({sendMessage}) {
|
|
|
|
let formToShow = 'talk-to-us';
|
|
|
|
let userIsLoggedIn = !! this.req.me;
|
|
let userHasPremiumSubscription = false;
|
|
if(userIsLoggedIn) {
|
|
let thisSubscription = await Subscription.findOne({user: this.req.me.id});
|
|
if(thisSubscription){
|
|
formToShow = 'contact';
|
|
userHasPremiumSubscription = true;
|
|
}
|
|
}
|
|
|
|
if(sendMessage) {
|
|
formToShow = 'contact';
|
|
}
|
|
// Respond with view.
|
|
return {
|
|
formToShow,
|
|
userIsLoggedIn,
|
|
userHasPremiumSubscription
|
|
};
|
|
|
|
}
|
|
|
|
|
|
};
|