diff --git a/hc/accounts/models.py b/hc/accounts/models.py index 63522dde..1b311ab0 100644 --- a/hc/accounts/models.py +++ b/hc/accounts/models.py @@ -35,7 +35,8 @@ class Profile(models.Model): path = reverse("hc-check-token", args=[self.user.username, token]) ctx = { - "login_link": settings.SITE_ROOT + path, + "button_text": "Log In", + "button_url": settings.SITE_ROOT + path, "inviting_profile": inviting_profile } emails.login(self.user.email, ctx) @@ -46,7 +47,10 @@ class Profile(models.Model): self.save() path = reverse("hc-set-password", args=[token]) - ctx = {"set_password_link": settings.SITE_ROOT + path} + ctx = { + "button_text": "Set Password", + "button_url": settings.SITE_ROOT + path + } emails.set_password(self.user.email, ctx) def set_api_key(self): diff --git a/hc/front/templatetags/hc_extras.py b/hc/front/templatetags/hc_extras.py index 3014db9a..4a61d181 100644 --- a/hc/front/templatetags/hc_extras.py +++ b/hc/front/templatetags/hc_extras.py @@ -1,5 +1,6 @@ from django import template from django.conf import settings +from django.utils.safestring import mark_safe from hc.lib.date import format_duration @@ -21,6 +22,11 @@ def site_name(): return settings.SITE_NAME +@register.simple_tag +def escaped_site_name(): + return mark_safe(settings.SITE_NAME.replace(".", ".")) + + @register.simple_tag def site_root(): return settings.SITE_ROOT diff --git a/hc/lib/emails.py b/hc/lib/emails.py index 086478a6..a6b4b5a6 100644 --- a/hc/lib/emails.py +++ b/hc/lib/emails.py @@ -1,9 +1,9 @@ from django.conf import settings -from djmail.template_mail import InlineCSSTemplateMail +from djmail.template_mail import TemplateMail def send(name, to, ctx): - o = InlineCSSTemplateMail(name) + o = TemplateMail(name) ctx["SITE_ROOT"] = settings.SITE_ROOT o.send(to, ctx) diff --git a/requirements.txt b/requirements.txt index d6b4d835..4620f2ec 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,7 +4,6 @@ django-ses-backend==0.1.1 Django==1.10.1 django_compressor==2.1 djmail==0.11.0 -premailer==2.9.6 psycopg2==2.6.1 pytz==2016.7 requests==2.9.1 diff --git a/templates/emails/alert-body-html.html b/templates/emails/alert-body-html.html index 6c9b9a37..f97c5b87 100644 --- a/templates/emails/alert-body-html.html +++ b/templates/emails/alert-body-html.html @@ -2,24 +2,26 @@ {% load hc_extras %} {% block content %} -
- This is a notification sent by {% site_name %}.
-
- The check {{ check.name_then_code }}
- has gone {{ check.status|upper }}.
-
Here is a summary of all your checks:
+This is a notification sent by {% site_name %}. +P.S. +P.S. Find this service useful? Support it by upgrading to a premium account! -
+Thanks,
The Healthchecks.io Team
-
|
+ ||||||||||||||
+
+
|
{{ inviting_profile }} invites you to their - {% site_name %} account.
+ {{ inviting_profile }} invites you to their + {% escaped_site_name %} account. +You will be able to manage their + You will be able to manage their existing monitoring checks and set up new ones. If you already have your - own account on healthchecks.io, you will be able to switch - between the two - accounts.
+ own account on {% site_name %}, you will be able to switch + between the two accounts. +To log into {% site_name %}, please press the button below:
+To log into {% escaped_site_name %}, +please press the button below: +{% endblock %} + + +{% block content_more %} +Thanks,
-
-
- Log In
-
- |
-
Thanks,
The Healthchecks.io Team
- P.S. Need help getting started? Check out our - help documentation. - Or, just reply to this email with any questions or issues you have. -
- -
- If you’re having trouble clicking the log in button, copy and paste the URL below into your web browser. - - - |
-
This is a monthly report sent by {% site_name %}.
- +Just one more thing to check: +Just one more thing to check: Do you have more cron jobs, not yet on this list, that would benefit from monitoring? -Get the ball rolling by adding one more!
+Get the ball rolling by adding one more! +Cheers,
The Healthchecks.io Team
Hello,
-Here's a link to set a password for your account on {% site_name %}:
- +{% block content %} +Hello,
- --
- Regards,
- {% site_name %}
-
- | Name | -Last Ping | ++ | Name | +Last Ping | ||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
- {% if check.get_status == "new" %} - NEW - {% elif check.get_status == "paused" %} - PAUSED - {% elif check.in_grace_period %} - LATE - {% elif check.get_status == "up" %} - UP - {% elif check.get_status == "down" %} - DOWN - {% endif %} + |
+
|
- + |
{% if check.name %}
{% if check.name|length > 20 %}
{{ check.name }}
@@ -75,26 +33,37 @@
{{ check.name }}
{% endif %}
{% else %}
- unnamed
+ unnamed
{% endif %}
{% if check.tags %}
- {% for tag in check.tags_list %} - {{ tag }} - {% endfor %} +
|
- + |
{% if check.last_ping %}
{{ check.last_ping|naturaltime }}
+ + Show Log… {% else %} Never {% endif %} - - |
- - Log |