diff --git a/bookwyrm/emailing.py b/bookwyrm/emailing.py index 03cf4772e..2271077b1 100644 --- a/bookwyrm/emailing.py +++ b/bookwyrm/emailing.py @@ -18,6 +18,12 @@ def email_data(): } +def test_email(user): + """Just an admin checking if emails are sending""" + data = email_data() + send_email(user.email, *format_email("test", data)) + + def email_confirmation_email(user): """newly registered users confirm email address""" data = email_data() diff --git a/bookwyrm/templates/email/test/html_content.html b/bookwyrm/templates/email/test/html_content.html new file mode 100644 index 000000000..7cf577f45 --- /dev/null +++ b/bookwyrm/templates/email/test/html_content.html @@ -0,0 +1,12 @@ +{% extends 'email/html_layout.html' %} +{% load i18n %} + +{% block content %} +
+{% blocktrans trimmed %} +This is a test email. +{% endblocktrans %} +
+ + +{% endblock %} diff --git a/bookwyrm/templates/email/test/subject.html b/bookwyrm/templates/email/test/subject.html new file mode 100644 index 000000000..6ddada523 --- /dev/null +++ b/bookwyrm/templates/email/test/subject.html @@ -0,0 +1,4 @@ +{% load i18n %} +{% blocktrans trimmed %} +Test email +{% endblocktrans %} diff --git a/bookwyrm/templates/email/test/text_content.html b/bookwyrm/templates/email/test/text_content.html new file mode 100644 index 000000000..9d8a8f685 --- /dev/null +++ b/bookwyrm/templates/email/test/text_content.html @@ -0,0 +1,9 @@ +{% extends 'email/text_layout.html' %} +{% load i18n %} +{% block content %} +{% blocktrans trimmed %} +This is a test email. +{% endblocktrans %} + + +{% endblock %} diff --git a/bookwyrm/templates/settings/email_config.html b/bookwyrm/templates/settings/email_config.html new file mode 100644 index 000000000..3b10761ec --- /dev/null +++ b/bookwyrm/templates/settings/email_config.html @@ -0,0 +1,96 @@ +{% extends 'settings/layout.html' %} +{% load humanize %} +{% load i18n %} +{% load celery_tags %} + +{% block title %}{% trans "Email Configuration" %}{% endblock %} + +{% block header %}{% trans "Email Configuration" %}{% endblock %} + +{% block panel %} + +{% if error %} +{{ email_backend }}
+ {{ email_host }}
+ {% firstof email_host_user "-" %}
+ {{ email_port }}
+ + {% blocktrans trimmed with email=request.user.email %} + Send test email to {{ email }} + {% endblocktrans %} +
+ +