Ghost/ghost/admin/app/adapters/email.js
Kevin Ansfield c1039f929c Added ability to retry failed emails from the confirm modal (#1412)
no issue

- adds a `.retry()` method to the email model+adapter
- adds a retry email task to the publishmenu that follows the same retry-then-poll behaviour as the regular email confirmation
- show a retry button in the confirm email modal if the original send failed
- increases max "immediate failure" poll timeout to 15sec (an 8sec retry-to-failure time has been seen locally)
2019-11-22 15:09:48 +00:00

15 lines
340 B
JavaScript

import ApplicationAdapter from './application';
export default ApplicationAdapter.extend({
retry(model) {
let url = `${this.buildURL('email', model.get('id'))}retry/`;
return this.ajax(url, 'PUT', {data: {}}).then((data) => {
this.store.pushPayload(data);
return model;
});
}
});