diff options
Diffstat (limited to 'client/components/rules/actions/mailActions.js')
-rw-r--r-- | client/components/rules/actions/mailActions.js | 57 |
1 files changed, 28 insertions, 29 deletions
diff --git a/client/components/rules/actions/mailActions.js b/client/components/rules/actions/mailActions.js index 40cbc280..87cb925c 100644 --- a/client/components/rules/actions/mailActions.js +++ b/client/components/rules/actions/mailActions.js @@ -1,35 +1,34 @@ BlazeComponent.extendComponent({ - onCreated() { - - }, + onCreated() {}, events() { - return [{ - 'click .js-mail-action' (event) { - const emailTo = this.find('#email-to').value; - const emailSubject = this.find('#email-subject').value; - const emailMsg = this.find('#email-msg').value; - const trigger = this.data().triggerVar.get(); - const ruleName = this.data().ruleName.get(); - const triggerId = Triggers.insert(trigger); - const boardId = Session.get('currentBoard'); - const desc = Utils.getTriggerActionDesc(event, this); - const actionId = Actions.insert({ - actionType: 'sendEmail', - emailTo, - emailSubject, - emailMsg, - boardId, - desc, - }); - Rules.insert({ - title: ruleName, - triggerId, - actionId, - boardId, - }); + return [ + { + 'click .js-mail-action'(event) { + const emailTo = this.find('#email-to').value; + const emailSubject = this.find('#email-subject').value; + const emailMsg = this.find('#email-msg').value; + const trigger = this.data().triggerVar.get(); + const ruleName = this.data().ruleName.get(); + const triggerId = Triggers.insert(trigger); + const boardId = Session.get('currentBoard'); + const desc = Utils.getTriggerActionDesc(event, this); + const actionId = Actions.insert({ + actionType: 'sendEmail', + emailTo, + emailSubject, + emailMsg, + boardId, + desc, + }); + Rules.insert({ + title: ruleName, + triggerId, + actionId, + boardId, + }); + }, }, - }]; + ]; }, - }).register('mailActions'); |