diff --git a/Main/templates/emails/email_base.html b/Main/templates/emails/email_base.html index 34be9cb..a3fc9d3 100644 --- a/Main/templates/emails/email_base.html +++ b/Main/templates/emails/email_base.html @@ -6,15 +6,300 @@ - - - {% block title %}{# This block can be overriden to change the title of the email #}{% endblock %} + + + + + + - -

Hello, {{ target_user }}

-{% block body %}{# This block can be overriden to change the body of the email #}{% endblock %} -  -

This email was auto-generated by the CodeReview website

-

Help

+ + + + + + + + + diff --git a/Main/templates/emails/hr.html b/Main/templates/emails/hr.html new file mode 100644 index 0000000..0605456 --- /dev/null +++ b/Main/templates/emails/hr.html @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/Main/templates/emails/p_attrs.txt b/Main/templates/emails/p_attrs.txt new file mode 100644 index 0000000..f4d2c42 --- /dev/null +++ b/Main/templates/emails/p_attrs.txt @@ -0,0 +1 @@ +style="line-height: 24px; font-size: 16px; width: 100%; margin: 0;" \ No newline at end of file diff --git a/Main/templates/emails/review_accepted.html b/Main/templates/emails/review_accepted.html index 35b72de..0154cb6 100644 --- a/Main/templates/emails/review_accepted.html +++ b/Main/templates/emails/review_accepted.html @@ -7,7 +7,9 @@ {% block title %}Review accepted by {{ review.reviewer }}{% endblock %} {% block body %} -

We're emailing to let you know that the review created by {{ review.student }} has been accepted + {% load email_tags %} +

We're emailing to let you know that the review created by {{ review.student }} has been accepted by {{ review.reviewer }}.

-

Once the review is complete, you can view it's grade in the Instructor section of the CodeReview website.

+

Once the review is complete, you can view + it's grade in the Instructor section of the CodeReview website.

{% endblock %} diff --git a/Main/templates/emails/review_completed.html b/Main/templates/emails/review_completed.html index fe1b8ac..470bff4 100644 --- a/Main/templates/emails/review_completed.html +++ b/Main/templates/emails/review_completed.html @@ -7,10 +7,14 @@ {% block title %}Review completed by {{ review.reviewer }}{% endblock %} {% block body %} -

We're emailing to let you know that a review by {{ review.student }} has been completed + {% load email_tags %} +

We're emailing to let you know that a review by {{ review.student }} has been completed by {{ review.reviewer }}.

-

Score: {{ review.score_fraction }}

-

Comments: {{ review.additional_comments|default:"No Additional Comments" }}

-

For more information, navigate to the Instructor section of the website and click the "view" link to the right of + {% separator %} +

Score: {{ review.score_fraction }}

+

Comments: {{ review.additional_comments|default:"No Additional Comments" }}

+ {% separator %} +

For more information, navigate to the Instructor section of the website and click the "view" link + to the right of the review

{% endblock %} diff --git a/Main/templates/emails/review_created.html b/Main/templates/emails/review_created.html index daea4b2..0ab973b 100644 --- a/Main/templates/emails/review_created.html +++ b/Main/templates/emails/review_created.html @@ -7,7 +7,9 @@ {% block title %}New Review Created by {{ review.student }}{% endblock %} {% block body %} -

We're emailing to let you know that a new review has been created by {{ review.student }}.

-

To claim this review, navigate to the CodeReview site and click the "claim" button to the right of the + {% load email_tags %} +

We're emailing to let you know that a new review has been created by {{ review.student }}.

+

To claim this review, navigate to the CodeReview site and click the "claim" button to the right of + the review.

{% endblock %} diff --git a/Main/templatetags/email_tags.py b/Main/templatetags/email_tags.py new file mode 100644 index 0000000..31ce0d0 --- /dev/null +++ b/Main/templatetags/email_tags.py @@ -0,0 +1,26 @@ +""" + This file defines custom tags to use for emails +""" + +from django import template + +register = template.Library() + + +@register.inclusion_tag('emails/hr.html') +def separator() -> dict: + """ + This tag creates a horizontal separator, usually you can do this with
, however most email clients + don't support it, so we need to make a work-around. + """ + + return {} + + +@register.inclusion_tag("emails/p_attrs.txt") +def p_attrs() -> dict: + """ + This tag add common attributes to a

element that makes it look better on email clients + """ + + return {}