in htdocs/js/selfserve.js [303:334]
async function mailinglist_new_submit(form) {
const data = new FormData(form);
const moderators = new Array();
for (const modemail of data.get("moderators").split("\n")) {
const email_trimmed = modemail.trim();
if (email_trimmed.length > 4) {
moderators.push(email_trimmed);
}
}
const listpart = data.get("listpart");
let is_private = data.get("private") === "yes";
if (listpart == "private" || listpart == "security") {
is_private = true;
}
const resp = await POST("/api/mailinglist", {
json: {
listpart: listpart,
domainpart: data.get("domainpart"),
moderators: moderators,
muopts: data.get("muopts"),
private: is_private,
trailer: data.get("trailer") === "yes",
expedited: data.get("expedited") === "yes"
}
});
const result = await resp.json();
if (result.success) {
toast(result.message, type="success", redirect_on_close="/");
} else {
toast(result.message);
}
}