public static void setNonHtmlMessage(CommandSender sender, String[] args) { if (inProgress(sender.getName())) { switch (getCurrentEmail(sender.getName())) { case "simple": LogHelper.showWarning("emailNonHtmlNotAllowed", sender); return; case "multi": LogHelper.showWarning("emailNonHtmlNotAllowed", sender); return; case "html": break; default: LogHelper.showWarning("emailNotInProgressEdit", sender); return; } HtmlEmail email = htmlEmail.get(sender.getName()); try { email.setMsg(Utils.implode(args, " ")); } catch (EmailException e) { sendErrorMessage(sender, e); return; } LogHelper.showWarning("emailNonHtmlMessageSet", sender); htmlEmail.put(sender.getName(), email); } else { LogHelper.showWarning("emailNotInProgressEdit", sender); } }
static void editMessageMulti(CommandSender sender, String[] args) { MultiPartEmail email = multiEmail.get(sender.getName()); try { email.setMsg(Utils.implode(args, " ")); } catch (EmailException e) { sendErrorMessage(sender, e); return; } LogHelper.showInfo("emailMessageSet", sender); multiEmail.put(sender.getName(), email); }
static void editSubjectHTML(CommandSender sender, String[] args) { HtmlEmail email = htmlEmail.get(sender.getName()); email.setSubject(Utils.implode(args, " ")); LogHelper.showInfo("emailSubjectSet", sender); htmlEmail.put(sender.getName(), email); }
static void editSubjectMulti(CommandSender sender, String[] args) { MultiPartEmail email = multiEmail.get(sender.getName()); email.setSubject(Utils.implode(args, " ")); LogHelper.showInfo("emailSubjectSet", sender); multiEmail.put(sender.getName(), email); }