Skip to content

Commit

Permalink
Merge pull request #999 from maykinmedia/feature/2059-add-email-desig…
Browse files Browse the repository at this point in the history
…n-templates-cases

[#2059] Add emailnotification templates
  • Loading branch information
alextreme authored Feb 14, 2024
2 parents eaf617e + 1132a67 commit b4d6777
Show file tree
Hide file tree
Showing 36 changed files with 908 additions and 382 deletions.
1 change: 1 addition & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions requirements/base.in
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ furl # processing urls
weasyprint # export to pdf
pywatchman
tinycss2

css_inline

# Framework libraries
Django>=3.2.11<4.0
Expand All @@ -37,7 +37,7 @@ django-view-breadcrumbs
markdown
django_better_admin_arrayfield
humanfriendly
git+https://github.com/maykinmedia/mail-editor.git@255bb498b1a0ddee12be4913ed90e7ccdc79e7a0#egg=mail-editor
git+https://github.com/maykinmedia/mail-editor.git@36ea073847bbea4aef3c97723f988927876b7ec9#egg=mail-editor
fontawesomefree
django-timeline-logger
django-csp
Expand Down
12 changes: 5 additions & 7 deletions requirements/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ cryptography==41.0.7
# josepy
# mozilla-django-oidc
# pyopenssl
css-inline==0.13.0
# via -r requirements/base.in
cssselect2==0.4.1
# via
# svglib
Expand Down Expand Up @@ -296,9 +298,7 @@ face==20.1.1
fontawesomefree==6.4.2
# via -r requirements/base.in
fonttools[woff]==4.29.1
# via
# fonttools
# weasyprint
# via weasyprint
furl==2.1.3
# via
# -r requirements/base.in
Expand Down Expand Up @@ -344,7 +344,7 @@ lxml==4.9.1
# maykin-python3-saml
# svglib
# xmlsec
mail-editor @ git+https://github.com/maykinmedia/mail-editor.git@255bb498b1a0ddee12be4913ed90e7ccdc79e7a0
mail-editor @ git+https://github.com/maykinmedia/mail-editor.git@36ea073847bbea4aef3c97723f988927876b7ec9
# via -r requirements/base.in
mail-parser==3.15.0
# via django-yubin
Expand Down Expand Up @@ -481,9 +481,7 @@ sqlparse==0.4.4
svglib==1.5.1
# via easy-thumbnails
tablib[html,ods,xls,xlsx,yaml]==3.1.0
# via
# django-import-export
# tablib
# via django-import-export
tinycss2==1.1.1
# via
# -r requirements/base.in
Expand Down
9 changes: 5 additions & 4 deletions requirements/ci.txt
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,10 @@ cryptography==41.0.7
# josepy
# mozilla-django-oidc
# pyopenssl
css-inline==0.13.0
# via
# -c requirements/base.txt
# -r requirements/base.txt
cssselect==1.1.0
# via pyquery
cssselect2==0.4.1
Expand Down Expand Up @@ -465,7 +469,6 @@ easy-thumbnails[svg]==2.8.5
# -r requirements/base.txt
# django-filer
# djangocms-picture
# easy-thumbnails
ecs-logging==2.1.0
# via
# -c requirements/base.txt
Expand Down Expand Up @@ -507,7 +510,6 @@ fonttools[woff]==4.29.1
# via
# -c requirements/base.txt
# -r requirements/base.txt
# fonttools
# weasyprint
freezegun==1.1.0
# via -r requirements/test-tools.in
Expand Down Expand Up @@ -600,7 +602,7 @@ lxml==4.9.1
# pyquery
# svglib
# xmlsec
mail-editor @ git+https://github.com/maykinmedia/mail-editor.git@255bb498b1a0ddee12be4913ed90e7ccdc79e7a0
mail-editor @ git+https://github.com/maykinmedia/mail-editor.git@36ea073847bbea4aef3c97723f988927876b7ec9
# via
# -c requirements/base.txt
# -r requirements/base.txt
Expand Down Expand Up @@ -865,7 +867,6 @@ tablib[html,ods,xls,xlsx,yaml]==3.1.0
# -c requirements/base.txt
# -r requirements/base.txt
# django-import-export
# tablib
tblib==1.7.0
# via -r requirements/test-tools.in
text-unidecode==1.3
Expand Down
9 changes: 5 additions & 4 deletions requirements/dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,10 @@ cryptography==41.0.7
# josepy
# mozilla-django-oidc
# pyopenssl
css-inline==0.13.0
# via
# -c requirements/ci.txt
# -r requirements/ci.txt
cssselect==1.1.0
# via
# -c requirements/ci.txt
Expand Down Expand Up @@ -515,7 +519,6 @@ easy-thumbnails[svg]==2.8.5
# -r requirements/ci.txt
# django-filer
# djangocms-picture
# easy-thumbnails
ecs-logging==2.1.0
# via
# -c requirements/ci.txt
Expand Down Expand Up @@ -573,7 +576,6 @@ fonttools[woff]==4.29.1
# via
# -c requirements/ci.txt
# -r requirements/ci.txt
# fonttools
# weasyprint
freezegun==1.1.0
# via
Expand Down Expand Up @@ -698,7 +700,7 @@ lxml==4.9.1
# pyquery
# svglib
# xmlsec
mail-editor @ git+https://github.com/maykinmedia/mail-editor.git@255bb498b1a0ddee12be4913ed90e7ccdc79e7a0
mail-editor @ git+https://github.com/maykinmedia/mail-editor.git@36ea073847bbea4aef3c97723f988927876b7ec9
# via
# -c requirements/ci.txt
# -r requirements/ci.txt
Expand Down Expand Up @@ -1043,7 +1045,6 @@ tablib[html,ods,xls,xlsx,yaml]==3.1.0
# -c requirements/ci.txt
# -r requirements/ci.txt
# django-import-export
# tablib
tblib==1.7.0
# via
# -c requirements/ci.txt
Expand Down
9 changes: 9 additions & 0 deletions src/open_inwoner/cms/utils/page_display.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,14 @@
from open_inwoner.cms.cases.cms_apps import CasesApphook
from open_inwoner.cms.collaborate.cms_apps import CollaborateApphook
from open_inwoner.cms.inbox.cms_apps import InboxApphook
from open_inwoner.cms.profile.cms_apps import ProfileApphook

cms_apps = {
"inbox": InboxApphook,
"collaborate": CollaborateApphook,
"cases": CasesApphook,
"ssd": SSDApphook,
"profile": ProfileApphook,
}


Expand Down Expand Up @@ -56,6 +58,13 @@ def benefits_page_is_published() -> bool:
return _is_published("ssd")


def profile_page_is_published() -> bool:
"""
:returns: True if the profile page published, False otherwise
"""
return _is_published("profile")


def get_active_app_names() -> list[str]:
return list(
Page.objects.published()
Expand Down
32 changes: 21 additions & 11 deletions src/open_inwoner/conf/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -774,17 +774,6 @@
# django import-export
IMPORT_EXPORT_USE_TRANSACTIONS = True

# mail-editor
from .parts.maileditor import MAIL_EDITOR_BASE_CONTEXT, MAIL_EDITOR_CONF # noqa

CKEDITOR_CONFIGS = {
"mail_editor": {
"allowedContent": True,
"height": 600, # This is optional
"entities": False, # This is added because CKEDITOR escapes the ' when you do an if statement
}
}

# invite expires in X days after sending
INVITE_EXPIRY_DAYS = config("INVITE_EXPIRY_DAYS", default=30)

Expand Down Expand Up @@ -898,6 +887,27 @@
SECURE_REFERRER_POLICY = "same-origin"


# mail-editor
from .parts.maileditor import ( # noqa
MAIL_EDITOR_BASE_CONTEXT,
MAIL_EDITOR_CONF,
MAIL_EDITOR_DYNAMIC_CONTEXT,
)

MAIL_EDITOR_BASE_HOST = BASE_URL

CKEDITOR_CONFIGS = {
"mail_editor": {
"allowedContent": True,
"contentsCss": [
"/static/mailcss/email.css"
], # Enter the css file used to style the email.
"height": 600, # This is optional
"entities": False, # This is added because CKEDITOR escapes the ' when you do an if statement
}
}


#
# Project specific settings
#
Expand Down
3 changes: 3 additions & 0 deletions src/open_inwoner/conf/local_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,6 @@

INSTALLED_APPS += ["debug_toolbar"]
MIDDLEWARE += ["debug_toolbar.middleware.DebugToolbarMiddleware"]


MAIL_EDITOR_BASE_HOST = "http://localhost:8000"
22 changes: 22 additions & 0 deletions src/open_inwoner/conf/parts/case_document_notification.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<p>Beste</p>
<p>U ontvangt deze email, omdat er bij een van uw zaken een document als bijlage is toegevoegd.</p>

<table>
<tr>
<th>Zaakidentificatie</th>
<td>{{ identification }}</td>
</tr>
<tr>
<th>Zaaktype</th>
<td>{{ type_description }}</td>
</tr>
<tr>
<th>Startdatum</th>
<td>{{ start_date }}</td>
</tr>
</table>

<p><a href="{{ case_link }}">Ga naar uw zaak</a><span class="color--secondary"> &rarr;</span></p>
<p>Met vriendelijke groet,
{{ site_name }}
</p>
95 changes: 95 additions & 0 deletions src/open_inwoner/conf/parts/case_status_notification.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
<table role="presentation" border="0" cellspacing="0" cellpadding="0" width="100%" class="table-mail">
<tbody>
<tr>
<td class="td-mail td__padding-all" colspan="6">
<p>Beste inwoner,</p>
<p>Er is iets veranderd in &eacute;&eacute;n van uw aanvragen.</p>
</td>
</tr>
<tr>
<td class="spacing__extra" colspan="6">
&nbsp;
</td>
</tr>
<tr>
<td class="td-mail td-mail__bg-info td__padding-all" colspan="6">
<h1>Nieuw:</h1>
</td>
</tr>
<tr class="tr--responsive">
<td class="td--responsive td-mail td-mail__bg-info td__padding-all" colspan="3">
<p><span class="text-color__small-gray-900">Aanvraag: </span></p>
<h2>{{ type_description }}</h2>
</td>
<td class="td--responsive td-mail td-mail__bg-info td__padding-all" colspan="3">
<p><span class="text-color__small-gray-900">Zaaknummer: </span><br/>{{ identification }}</p>
</td>
</tr>

<!-- Table with different column-widths -->
<tr>
<td class="td-mail td-mail__bg-info td__padding-all" colspan="6">
<div class="td-mail__bg-white">
<p>
<table role="presentation" border="0" cellspacing="0" cellpadding="0" width="100%">
<tr>
<td width="35" class="td-mail td__padding-left align-center">
<img src="/static/img/mail/info_info-blue.jpg" width="20" height="20" alt="" class="mail__icon">
</td>
<td class="td__padding-top td__padding-right td__padding-bottom">
<p class="text-color__info">De status is gewijzigd naar <span class="status_current"><strong><a href="{{ case_link }}" class="text-color__info">{{ type_description }}</a></strong></span>.</p>
</td>
</tr>
</table>
</div>
</td>
</tr>
<!-- end of Table with differing column-widths -->

<tr>
<td class="td-mail td-mail__bg-info td__padding-all td__info-link" colspan="6">
<p>U hoeft niets te doen. Zodra er weer een update beschikbaar is ontvangt u hier een melding over. U kunt wel inloggen om uw aanvraag te bekijken.</p>
<p><strong><a href="{{ case_link }}" class="color--primary">Log in</a><span class="color--primary"> &rarr;</span></strong></p>
</td>
</tr>
<tr>
<td class="spacing__extra" colspan="6">
&nbsp;
</td>
</tr>
<tr>
<td class="td-mail td__padding-all" colspan="6">
<p>Met vriendelijke groet,</p>
<p>&nbsp;</p>
<p>{{ site_name }}</p>
</td>
</tr>
<tr class="tr-mail">
<td class="td-mail spacer-bottom td__padding-zero" colspan="6">
<!-- <hr> styling --> &nbsp;
</td>
</tr>
<tr>
<td class="td-mail td__padding-top td__padding-right td__padding-left" colspan="6">
<p>Dit bericht is automatisch verzonden. U kunt <strong>niet reageren</strong> op deze e-mail. </p>
<p>&nbsp;</p>
<p><strong>Contact opnemen</strong></p>
</td>
</tr>
<tr>
<td class="td--responsive td-mail td__padding-right td__padding-bottom td__padding-left" colspan="3"><p><a href="https://example.com">Ga naar onze contactpagina</a></p>
</td>
<td class="td--responsive td-mail td__padding-right td__padding-bottom td__padding-left" colspan="3"><p><a href="tel:+14050" data-rel="external">Bel 14050</a></p></td>
</tr>
<tr class="tr-mail border-top">
<td class="td-mail border-top td__padding-zero" colspan="6">
<!-- <hr> styling --> &nbsp;
</td>
</tr>
<tr>
<td class="td-mail td__padding-all" colspan="6">
<p>Pas hier uw <a href="https://example.com">voorkeuren</a> aan voor de notificaties. </p>
</td>
</tr>
</tbody>
</table>
Loading

0 comments on commit b4d6777

Please sign in to comment.