2018-06-15 17:03:24 +02:00
|
|
|
import RestModel from "discourse/models/rest";
|
2020-12-01 15:31:26 -03:00
|
|
|
import { ajax } from "discourse/lib/ajax";
|
2021-06-29 19:54:18 +02:00
|
|
|
import { getProperties } from "@ember/object";
|
2015-11-20 12:30:04 -05:00
|
|
|
|
2023-03-17 10:18:42 +00:00
|
|
|
export default class EmailTemplate extends RestModel {
|
2015-11-20 12:30:04 -05:00
|
|
|
revert() {
|
2019-05-27 10:15:39 +02:00
|
|
|
return ajax(`/admin/customize/email_templates/${this.id}`, {
|
2020-09-04 13:42:47 +02:00
|
|
|
type: "DELETE",
|
|
|
|
}).then((result) =>
|
2018-06-15 17:03:24 +02:00
|
|
|
getProperties(result.email_template, "subject", "body", "can_revert")
|
|
|
|
);
|
2023-03-17 10:18:42 +00:00
|
|
|
}
|
|
|
|
}
|