forked from ui/django-post_office
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add demo context functionality and improve email template parsing
Introduce `demo_context` field for email template previews, with support for constructing and reparsing contexts dynamically. Enhance parsing logic for nested variables in templates and extend test coverage. Update Docker configurations for Celery, and streamline admin interfaces with new context actions.
- Loading branch information
1 parent
0fc7547
commit 4968b61
Showing
20 changed files
with
309 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<title>Some</title> | ||
</head> | ||
<body> | ||
{{ controller.topic }} | ||
{{ controller.stats.likes.bots }} | ||
{{ controller.stats.stars }} | ||
{{ controller.stats.likes.people }} | ||
|
||
|
||
{% for new in updates %} | ||
{{ controller.logic }} | ||
{% for like in new.likes %} | ||
{{ like.name }} | ||
{{ new.something_else }} | ||
{% endfor %} | ||
{{ new.interactions }} | ||
{{ new.extra_values.reposts }} | ||
{% endfor %} | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<title>Some</title> | ||
</head> | ||
<body> | ||
{{ controller.topic }} | ||
{{ controller.stats.stars }} | ||
{{ controller.stats.likes }} | ||
|
||
{% for new in updates %} | ||
{{ controller.subtopic }} | ||
{% for upd in new.changes %} | ||
{{ controller.subsubtopic }} | ||
{% endfor %} | ||
{{ new.interactions }} | ||
{{ new.extra_values.reposts }} | ||
{% endfor %} | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
FROM python:3.11 | ||
|
||
ENV PYTHONDONTWRITEBYTECODE=1 | ||
ENV PYTHONUNBUFFERED=1 | ||
|
||
RUN pip install pip --upgrade | ||
COPY . /app | ||
|
||
RUN pip install -r /app/demoapp/tests/requirements/test_requirements.txt | ||
|
||
WORKDIR /app | ||
|
||
CMD ["python", "-m", "celery", "-A", "demoapp", "worker", "-l", "info", "--concurrency=5"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
FROM python:3.11 | ||
|
||
ENV PYTHONDONTWRITEBYTECODE=1 | ||
ENV PYTHONUNBUFFERED=1 | ||
|
||
RUN pip install pip --upgrade | ||
COPY . /app | ||
|
||
RUN pip install -r /app/demoapp/tests/requirements/test_requirements.txt | ||
|
||
WORKDIR /app | ||
|
||
CMD ["python", "-m", "celery", "-A", "demoapp", "beat", "-l", "info"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Generated by Django 5.1.3 on 2024-12-20 08:01 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('sendmail', '0031_remove_newsletter_attachments_and_more'), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name='emailmergemodel', | ||
name='demo_context', | ||
field=models.JSONField(blank=True, help_text='Example context for previewing the email template.', null=True, verbose_name='Demo context'), | ||
), | ||
] |
Oops, something went wrong.