/send-email/", methods=["GET", "POST"])
-@rank_required(UserRank.MODERATOR)
-def send_email(username):
- user = User.query.filter_by(username=username).first()
- if user is None:
- abort(404)
-
- next_url = url_for("users.profile", username=user.username)
-
- if user.email is None:
- flash("User has no email address!", "danger")
- return redirect(next_url)
-
- form = SendEmailForm(request.form)
- if form.validate_on_submit():
- addAuditLog(AuditSeverity.MODERATION, current_user,
- "Sent email to {}".format(user.display_name), url_for("users.profile", username=username))
-
- text = form.text.data
- html = render_markdown(text)
- task = sendEmailRaw.delay([user.email], form.subject.data, text, html)
- return redirect(url_for("tasks.check", id=task.id, r=next_url))
-
- return render_template("users/send_email.html", form=form)
diff --git a/app/templates/admin/list.html b/app/templates/admin/list.html
index 4f426747..1dc75e33 100644
--- a/app/templates/admin/list.html
+++ b/app/templates/admin/list.html
@@ -13,6 +13,7 @@
License Editor
Version Editor
Warning Editor
+ Send bulk email
Sign in as another user
diff --git a/app/templates/admin/send_bulk_email.html b/app/templates/admin/send_bulk_email.html
new file mode 100644
index 00000000..39998e1b
--- /dev/null
+++ b/app/templates/admin/send_bulk_email.html
@@ -0,0 +1,23 @@
+{% extends "base.html" %}
+
+{% block title %}
+ {{ _("Send bulk email") }}
+{% endblock %}
+
+{% block content %}
+{{ self.title() }}
+
+
+ BE VERY CAREFUL.
+ This will send an email to all users with email addresses.
+
+
+{% from "macros/forms.html" import render_field, render_submit_field %}
+
+
+{% endblock %}
diff --git a/app/templates/users/send_email.html b/app/templates/admin/send_email.html
similarity index 80%
rename from app/templates/users/send_email.html
rename to app/templates/admin/send_email.html
index d802c7db..54dd7f94 100644
--- a/app/templates/users/send_email.html
+++ b/app/templates/admin/send_email.html
@@ -1,11 +1,11 @@
{% extends "base.html" %}
{% block title %}
- Send Email
+ {{ _("Send email to %(username)s", username=user.display_name) }}
{% endblock %}
{% block content %}
-Send Email
+{{ self.title() }}
{% from "macros/forms.html" import render_field, render_submit_field %}