2023-03-15 21:17:51 +08:00
|
|
|
import { action } from "@ember/object";
|
2023-10-11 02:38:59 +08:00
|
|
|
import { inject as service } from "@ember/service";
|
|
|
|
import { popupAjaxError } from "discourse/lib/ajax-error";
|
2023-07-21 05:31:20 +08:00
|
|
|
import IncomingEmail from "admin/models/incoming-email";
|
2023-10-11 02:38:59 +08:00
|
|
|
import AdminEmailLogs from "admin/routes/admin-email-logs";
|
2023-07-21 05:31:20 +08:00
|
|
|
import IncomingEmailModal from "../components/modal/incoming-email";
|
2017-02-23 01:51:33 +08:00
|
|
|
|
2023-03-15 21:17:51 +08:00
|
|
|
export default class AdminEmailBouncedRoute extends AdminEmailLogs {
|
2023-07-21 05:31:20 +08:00
|
|
|
@service modal;
|
2023-03-15 21:17:51 +08:00
|
|
|
status = "bounced";
|
2017-02-23 01:51:33 +08:00
|
|
|
|
2023-03-15 21:17:51 +08:00
|
|
|
@action
|
2023-07-21 05:31:20 +08:00
|
|
|
async showIncomingEmail(id) {
|
|
|
|
const model = await this.loadFromBounced(id);
|
|
|
|
this.modal.show(IncomingEmailModal, { model });
|
|
|
|
}
|
|
|
|
|
|
|
|
@action
|
|
|
|
async loadFromBounced(id) {
|
|
|
|
try {
|
|
|
|
return await IncomingEmail.findByBounced(id);
|
|
|
|
} catch (error) {
|
|
|
|
popupAjaxError(error);
|
|
|
|
}
|
2023-03-15 21:17:51 +08:00
|
|
|
}
|
|
|
|
}
|