settings: Send email after deactivating user.

This adds a feature where an admin can choose to send an email
with custom content to an user after they deactivated them.

Fixes #18943.
This commit is contained in:
Julia Bichler
2021-11-27 15:26:09 +01:00
committed by Tim Abbott
parent b8a760b14e
commit 0a278c39d2
16 changed files with 238 additions and 6 deletions

View File

@@ -118,6 +118,10 @@ export function launch(conf) {
}
const $submit_button = $dialog.find(".dialog_submit_button");
const $send_email_checkbox = $dialog.find(".send_email");
const $email_field = $dialog.find(".email_field");
$email_field.hide();
// This is used to link the submit button with the form, if present, in the modal.
// This makes it so that submitting this form by pressing Enter on an input element
@@ -140,6 +144,14 @@ export function launch(conf) {
conf.on_click(e);
});
$($send_email_checkbox).on("change", () => {
if ($($send_email_checkbox).is(":checked")) {
$email_field.show();
} else {
$email_field.hide();
}
});
overlays.open_modal("dialog_widget_modal", {
autoremove: true,
on_show: () => {