summaryrefslogtreecommitdiffstats
path: root/client/components/rules/actions/mailActions.js
diff options
context:
space:
mode:
Diffstat (limited to 'client/components/rules/actions/mailActions.js')
-rw-r--r--client/components/rules/actions/mailActions.js21
1 files changed, 21 insertions, 0 deletions
diff --git a/client/components/rules/actions/mailActions.js b/client/components/rules/actions/mailActions.js
new file mode 100644
index 00000000..0e4b539e
--- /dev/null
+++ b/client/components/rules/actions/mailActions.js
@@ -0,0 +1,21 @@
+BlazeComponent.extendComponent({
+ 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 actionId = Actions.insert({actionType: "sendEmail","emailTo":emailTo,"emailSubject":emailSubject,"emailMsg":emailMsg});
+ Rules.insert({title: ruleName, triggerId: triggerId, actionId: actionId});
+ },
+ }];
+},
+
+}).register('mailActions'); \ No newline at end of file