Files
wekan/client/components/rules/actions/mailActions.js
T
Lauri Ojansivu c06b429765 Include authorized card details in rule emails
Render dates, placement, labels, people, custom-field display values, notes and readable relationships behind an opt-in Details checkbox. Recheck source and related access, admin-only field policy and field definitions; do not serialize account secrets or stale linked-source snapshots.

Thirty-six Node suites and two local SMTP browser scenarios pass. Linked-source details and specialized fields remain open under #2713.

Thanks to kabi178, bbyszio and xet7 !
2026-09-28 19:44:33 +03:00

27 lines
990 B
JavaScript

import { Utils } from '/client/lib/utils';
import { saveRuleTriggerAction } from '/client/components/rules/rulesSaveHelper';
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 boardId = Session.get('currentBoard');
const desc = Utils.getTriggerActionDesc(event, tpl);
saveRuleTriggerAction(boardId, data.ruleId, ruleName, trigger, {
actionType: 'sendEmail',
emailTo,
emailSubject,
emailMsg,
includeCardDetails: tpl.find('#email-card-details').checked,
includeChecklistsAndComments: tpl.find('#email-discussion').checked,
includeAttachments: tpl.find('#email-attachments').checked,
boardId,
desc,
});
},
});