mirror of
https://github.com/wekan/wekan.git
synced 2026-03-13 17:06:13 +01:00
Convert all remaining BlazeComponent-based components to native Meteor Template pattern: activities, comments, all rules actions/triggers, swimlanes, users, gantt, import, and main utility components.
27 lines
771 B
JavaScript
27 lines
771 B
JavaScript
Template.mailActions.events({
|
|
'click .js-mail-action'(event, tpl) {
|
|
const emailTo = tpl.find('#email-to').value;
|
|
const emailSubject = tpl.find('#email-subject').value;
|
|
const emailMsg = tpl.find('#email-msg').value;
|
|
const data = Template.currentData();
|
|
const trigger = data.triggerVar.get();
|
|
const ruleName = data.ruleName.get();
|
|
const triggerId = Triggers.insert(trigger);
|
|
const boardId = Session.get('currentBoard');
|
|
const desc = Utils.getTriggerActionDesc(event, tpl);
|
|
const actionId = Actions.insert({
|
|
actionType: 'sendEmail',
|
|
emailTo,
|
|
emailSubject,
|
|
emailMsg,
|
|
boardId,
|
|
desc,
|
|
});
|
|
Rules.insert({
|
|
title: ruleName,
|
|
triggerId,
|
|
actionId,
|
|
boardId,
|
|
});
|
|
},
|
|
});
|