From 67210d49a63d7f7b4b4d1a8eadb2a63994189ea1 Mon Sep 17 00:00:00 2001 From: Ali Alfaifi Date: Wed, 16 Sep 2026 19:38:52 +0300 Subject: [PATCH] Add tenant-branded card frame for invite and bulk emails MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Override the edx-ace templates for the instructor enrolment invite (enrollenrolled, allowedenroll) and the bulk course-messages email (bulkemail) with a centred card frame: the tenant's logo (lms_configs.logo_image_url, absolute + non-SVG, else the platform logo), a greeting, the course name in #1B8354, a #1B8354 CTA button, the stock opt-out lines, and a footer "All rights reserved to © ". Tenant values are read through eox-tenant's `ednx` template tags so they resolve in both the web-request and Celery send paths. The templates are pure Django templates: an IS_FILE_RENDERED hook keeps Tutor's Jinja pass off them locally (prod clones the repo raw). Five new msgids are added to the theme catalogs (ar/en/fr) and the .mo files recompiled. Co-Authored-By: Claude Fable 5.1 --- tutorindigo/plugin.py | 17 +++ .../conf/locale/ar/LC_MESSAGES/django.mo | Bin 1707 -> 2108 bytes .../conf/locale/ar/LC_MESSAGES/django.po | 22 +++ .../conf/locale/en/LC_MESSAGES/django.po | 22 +++ .../conf/locale/fr/LC_MESSAGES/django.mo | Bin 1637 -> 2011 bytes .../conf/locale/fr/LC_MESSAGES/django.po | 22 +++ .../edx_ace/common/fx_base_body.html | 133 ++++++++++++++++++ .../ace_common/edx_ace/common/fx_cta.html | 12 ++ .../edx_ace/bulkemail/email/body.html | 48 +++++++ .../edx_ace/allowedenroll/email/body.html | 57 ++++++++ .../edx_ace/enrollenrolled/email/body.html | 31 ++++ 11 files changed, 364 insertions(+) create mode 100644 tutorindigo/templates/indigo/lms/templates/ace_common/edx_ace/common/fx_base_body.html create mode 100644 tutorindigo/templates/indigo/lms/templates/ace_common/edx_ace/common/fx_cta.html create mode 100644 tutorindigo/templates/indigo/lms/templates/bulk_email/edx_ace/bulkemail/email/body.html create mode 100644 tutorindigo/templates/indigo/lms/templates/instructor/edx_ace/allowedenroll/email/body.html create mode 100644 tutorindigo/templates/indigo/lms/templates/instructor/edx_ace/enrollenrolled/email/body.html diff --git a/tutorindigo/plugin.py b/tutorindigo/plugin.py index 6f25e4351..89ff7d1c8 100644 --- a/tutorindigo/plugin.py +++ b/tutorindigo/plugin.py @@ -61,6 +61,23 @@ ] ) +# Django templates (edx-ace emails) and compiled gettext catalogs must not go through Tutor's +# Jinja pass: locally Jinja would choke on {% blocktrans %} / {% include %}, and production +# builds clone this repo raw (PICASSO_THEME_DIRS) where Jinja never runs, so {% raw %} wrappers +# would reach Django verbatim. Copy them byte-for-byte in both worlds. +FX_VERBATIM_TEMPLATE_PREFIXES = ( + "indigo/lms/templates/ace_common/", + "indigo/lms/templates/instructor/edx_ace/", + "indigo/lms/templates/bulk_email/", +) + + +@hooks.Filters.IS_FILE_RENDERED.add() +def _do_not_render_django_email_templates(rendered: bool, path: str) -> bool: + if path.startswith(FX_VERBATIM_TEMPLATE_PREFIXES) or path.endswith(".mo"): + return False + return rendered + # init script: set theme automatically with open( diff --git a/tutorindigo/templates/indigo/conf/locale/ar/LC_MESSAGES/django.mo b/tutorindigo/templates/indigo/conf/locale/ar/LC_MESSAGES/django.mo index 5571b8db585c85151581205f53bff9e92fde7563..4b55e781d2a343f5d6dc98444cae5411b447f7e5 100644 GIT binary patch delta 612 zcmaLSOG`pQ6bJBQnLRBF>;Xm7A}O#U=EnZuh`;n%&j_OnF^t$l^dg=S<`5Pl z4;+IIxCr~;ChUf>ACF)U=I77`uVD);K{vdGL+}j_!Vg%sQkbVey#5;;!@?li|~!#Y=efsX1UJ31pEq_#sH7Ru=bt9x{xHOIO^REF;a zU#TP)RYIjzLZ}pe4^*0~oD(Xk_W$iH``Qw7;YgW_e65c8>bFBaq55?`$u8R#W^iGG jOM>$%g%4NILk4Sy0wpt4m*u?R65pYZJhFU=)De9FZ}qLI delta 211 zcmdlZu$s62o)F7a1|VPuVi_O~0b*_-?g3&D*a5@>K)e%(g@E`J5c2`?T`2tqNV5X* zZy?qIVn#*=hK(!?40=FX63Bl5l+*yyzkswTkXB}6V2}sWmOz>pNHIhL8O}g~bRZ4X t!@vZ@AOPet0L?)G%s?K zJw-^+rAvG0Llgx;Um}9~k1mu14gCEv^Ni0t`yPKv)?ZTE8NrGpQ^*N2f;=N?(Fh?q zI0J`a0j6LXCSWb}6eh7hhcS2sqwpH)@D@(MH#iPI;f+S>WVDBnJPsc5FV*l1stbv} z&LDH4i=i8^AN5_R9w@;qRKAv{@LR`89-EX^#w!7AVO9+ zr_wA}9GgmJGwHD+bp)MFA92Ge30d8WtJ42qp4|;?uu!7rqh0{wGe4(`7Pnvv?ztCMhSd13w~*E`TsD@ x*XZWts;~})D}T)sp6Jc_*wS)AwZ=#_8u(7&V;1{BnogQ!(4PFQVz9sutKa5}fvf-k delta 211 zcmcc3|CFcxo)F7a1|VPuVi_O~0b*_-?g3&D*a5@>K)e%(g@E`J5c2`?T`2tqNV5X* zZy?qIVn#*=hK(!?40=Esr0xMwQUXZ72hxH-nu85OO95%1kR^i-kYNOrFapv*Jq%1h q3<5wd1JE24zzpPp915~