diff options
Diffstat (limited to 'web-ui/app/js/mail_view')
-rw-r--r-- | web-ui/app/js/mail_view/data/mail_sender.js | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/web-ui/app/js/mail_view/data/mail_sender.js b/web-ui/app/js/mail_view/data/mail_sender.js index 4c7e07ea..d7247601 100644 --- a/web-ui/app/js/mail_view/data/mail_sender.js +++ b/web-ui/app/js/mail_view/data/mail_sender.js @@ -28,12 +28,18 @@ define( return defineComponent(mailSender); function mailSender() { - function successSendMail(on){ + function successSendingMail(on){ return function(result) { on.trigger(document, events.mail.sent, result); }; } + function failureSendingMail(on) { + return function(result) { + on.trigger(document, events.mail.send_failed); + } + }; + function successSaveDraft(on){ return function(result){ on.trigger(document, events.mail.draftSaved, result); @@ -50,7 +56,7 @@ define( dataType: 'json', contentType: 'application/json; charset=utf-8', data: JSON.stringify(data), - }).done(successSendMail(this)); + }).done(successSendingMail(this)).fail(failureSendingMail(this)); }; |