fix success response handling of sending digest preview email
This commit is contained in:
parent
6168b2c57a
commit
f885e5b5e6
|
@ -12,6 +12,7 @@ export default Ember.Controller.extend({
|
||||||
const model = this.get('model');
|
const model = this.get('model');
|
||||||
|
|
||||||
this.set('loading', true);
|
this.set('loading', true);
|
||||||
|
this.set('sentEmail', false);
|
||||||
EmailPreview.findDigest(this.get('lastSeen'), this.get('username')).then(email => {
|
EmailPreview.findDigest(this.get('lastSeen'), this.get('username')).then(email => {
|
||||||
model.setProperties(email.getProperties('html_content', 'text_content'));
|
model.setProperties(email.getProperties('html_content', 'text_content'));
|
||||||
this.set('loading', false);
|
this.set('loading', false);
|
||||||
|
|
|
@ -60,7 +60,7 @@ class Admin::EmailController < Admin::AdminController
|
||||||
message.to = params[:email]
|
message.to = params[:email]
|
||||||
begin
|
begin
|
||||||
Email::Sender.new(message, :digest).send
|
Email::Sender.new(message, :digest).send
|
||||||
render nothing: true
|
render json: success_json
|
||||||
rescue => e
|
rescue => e
|
||||||
render json: {errors: [e.message]}, status: 422
|
render json: {errors: [e.message]}, status: 422
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue