From f885e5b5e65d0f1443f746f02d7a5ad2ebfcd687 Mon Sep 17 00:00:00 2001 From: Neil Lalonde Date: Thu, 24 Nov 2016 15:05:33 -0500 Subject: [PATCH] fix success response handling of sending digest preview email --- .../admin/controllers/admin-email-preview-digest.js.es6 | 1 + app/controllers/admin/email_controller.rb | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/app/assets/javascripts/admin/controllers/admin-email-preview-digest.js.es6 b/app/assets/javascripts/admin/controllers/admin-email-preview-digest.js.es6 index b46fc4c2804..fa2950dd9a7 100644 --- a/app/assets/javascripts/admin/controllers/admin-email-preview-digest.js.es6 +++ b/app/assets/javascripts/admin/controllers/admin-email-preview-digest.js.es6 @@ -12,6 +12,7 @@ export default Ember.Controller.extend({ const model = this.get('model'); this.set('loading', true); + this.set('sentEmail', false); EmailPreview.findDigest(this.get('lastSeen'), this.get('username')).then(email => { model.setProperties(email.getProperties('html_content', 'text_content')); this.set('loading', false); diff --git a/app/controllers/admin/email_controller.rb b/app/controllers/admin/email_controller.rb index 06dfe3ad551..2d7798e6c2f 100644 --- a/app/controllers/admin/email_controller.rb +++ b/app/controllers/admin/email_controller.rb @@ -60,7 +60,7 @@ class Admin::EmailController < Admin::AdminController message.to = params[:email] begin Email::Sender.new(message, :digest).send - render nothing: true + render json: success_json rescue => e render json: {errors: [e.message]}, status: 422 end