2023-03-15 21:17:51 +08:00
|
|
|
import { action } from "@ember/object";
|
2016-05-03 05:15:32 +08:00
|
|
|
import AdminEmailLogs from "admin/routes/admin-email-logs";
|
2023-07-21 05:31:20 +08:00
|
|
|
import IncomingEmail from "admin/models/incoming-email";
|
|
|
|
import IncomingEmailModal from "../components/modal/incoming-email";
|
|
|
|
import { popupAjaxError } from "discourse/lib/ajax-error";
|
|
|
|
import { inject as service } from "@ember/service";
|
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
|
|
|
}
|
|
|
|
}
|