summaryrefslogtreecommitdiff
path: root/web-ui/app/js/mail_list_actions/ui/compose_trigger.js
diff options
context:
space:
mode:
Diffstat (limited to 'web-ui/app/js/mail_list_actions/ui/compose_trigger.js')
-rw-r--r--web-ui/app/js/mail_list_actions/ui/compose_trigger.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/web-ui/app/js/mail_list_actions/ui/compose_trigger.js b/web-ui/app/js/mail_list_actions/ui/compose_trigger.js
index 33430598..ec79cb26 100644
--- a/web-ui/app/js/mail_list_actions/ui/compose_trigger.js
+++ b/web-ui/app/js/mail_list_actions/ui/compose_trigger.js
@@ -38,9 +38,19 @@ define(
this.trigger(document, events.dispatchers.rightPane.openComposeBox);
};
+ this.showEmailSuccess = function () {
+ this.trigger(document, events.ui.userAlerts.displayMessage, {message: 'Your message was sent!', class: 'success'});
+ };
+
+ this.showEmailError = function (ev, data) {
+ this.trigger(document, events.ui.userAlerts.displayMessage, {message: 'Error, message not sent: ' + data.responseJSON.message, class: 'error'});
+ };
+
this.after('initialize', function () {
this.render();
this.on('click', this.enableComposing);
+ this.on(document, events.mail.sent, this.showEmailSuccess);
+ this.on(document, events.mail.send_failed, this.showEmailError);
});
}
}