diff options
Diffstat (limited to 'web-ui/app')
-rw-r--r-- | web-ui/app/js/mixins/with_mail_edit_base.js | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/web-ui/app/js/mixins/with_mail_edit_base.js b/web-ui/app/js/mixins/with_mail_edit_base.js index aa01e2cb..f892f08f 100644 --- a/web-ui/app/js/mixins/with_mail_edit_base.js +++ b/web-ui/app/js/mixins/with_mail_edit_base.js @@ -124,10 +124,19 @@ define( }); }; + this.trim_recipient = function(recipients) { + recipients.map(function(recipient) { + return recipient.trim(); + }); + } + this.sendMail = function () { this.cancelPostponedSaveDraft(); var mail = this.buildMail('sent'); - + mail.header.to = this.trim_recipient(mail.header.to); + mail.header.cc = this.trim_recipient(mail.header.cc); + mail.header.bcc = this.trim_recipient(mail.header.bcc); + if (allRecipientsAreEmails(mail)) { this.trigger(events.mail.send, mail); } else { |