wekan/client/components/rules/actions/mailActions.js

35 lines
988 B
JavaScript
Raw Normal View History

2018-08-19 18:53:50 +02:00
BlazeComponent.extendComponent({
2019-06-28 12:52:09 -05:00
onCreated() {},
2018-08-19 18:53:50 +02:00
events() {
2019-06-28 12:52:09 -05:00
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,
});
},
2018-09-14 17:39:37 +02:00
},
2019-06-28 12:52:09 -05:00
];
2018-09-14 17:39:37 +02:00
},
2018-09-16 01:50:36 +03:00
}).register('mailActions');