mirror of
https://github.com/empayre/fleet.git
synced 2024-11-07 01:15:22 +00:00
5f777729f0
* create deliver-demo-signup action * register call to action and styles * Update homepage.less * Update deliver-demo-signup.js * Update homepage.less * Update homepage.ejs * Update deliver-demo-signup.js * update message
47 lines
1.2 KiB
JavaScript
Vendored
47 lines
1.2 KiB
JavaScript
Vendored
module.exports = {
|
|
|
|
|
|
friendlyName: 'Deliver demo signup',
|
|
|
|
|
|
description: 'Delivers a message to an internal slack channel to notify us when someone signs up for our live Q&A',
|
|
|
|
|
|
inputs: {
|
|
|
|
emailAddress: {
|
|
required: true,
|
|
type: 'string',
|
|
description: 'The email address that will be invited to join a Fleet Q&A.',
|
|
example: 'hermione@hogwarts.edu'
|
|
}
|
|
},
|
|
|
|
|
|
exits: {
|
|
|
|
success: {
|
|
description: 'The message was sent successfully.'
|
|
}
|
|
|
|
},
|
|
|
|
|
|
fn: async function({emailAddress}) {
|
|
|
|
if (!sails.config.custom.slackWebhookUrlForContactForm) {
|
|
throw new Error(
|
|
'Message not delivered: slackWebhookUrlForContactForm needs to be configured in sails.config.custom. Here\'s the undelivered message: ' +
|
|
`New demo session signup: (Remember: we have to invite them to the next demo session.) cc @sales `+
|
|
`Email: ${emailAddress}`
|
|
);
|
|
} else {
|
|
await sails.helpers.http.post(sails.config.custom.slackWebhookUrlForContactForm, {
|
|
text: `New demo session signup: (Remember: we have to invite them to the next demo session.) cc @sales \n`+
|
|
`Email: ${emailAddress}`
|
|
});
|
|
}
|
|
}
|
|
|
|
};
|