Skip to content

Commit e1b1c93

Browse files
authored
Merge pull request #199 from PROCOLLAB-github/feature/mailing
Рассылка писем участникам программ
2 parents 7fca630 + 5b7ea3a commit e1b1c93

33 files changed

Lines changed: 2191 additions & 25 deletions

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
### Run project
2727

2828
🚀 Run project via `python manage.py runserver`
29-
3029
## For developers
3130

3231
### Install pre-commit hooks
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Generated by Django 4.2.3 on 2023-09-30 09:44
2+
3+
from django.db import migrations
4+
5+
6+
class Migration(migrations.Migration):
7+
8+
dependencies = [
9+
("files", "0005_alter_userfile_options"),
10+
]
11+
12+
operations = [
13+
migrations.AlterModelOptions(
14+
name="userfile",
15+
options={
16+
"ordering": ["datetime_uploaded"],
17+
"verbose_name": "Файл",
18+
"verbose_name_plural": "Файлы",
19+
},
20+
),
21+
]

mailing/__init__.py

Whitespace-only changes.

mailing/admin.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
from django.contrib import admin
2+
from .models import MailingSchema
3+
4+
5+
@admin.register(MailingSchema)
6+
class MailingSchemaAdmin(admin.ModelAdmin):
7+
list_display = (
8+
"id",
9+
"name",
10+
)
11+
list_display_links = (
12+
"id",
13+
"name",
14+
)
15+
search_fields = (
16+
"id",
17+
"name",
18+
)

mailing/apps.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
from django.apps import AppConfig
2+
3+
4+
class MailingConfig(AppConfig):
5+
default_auto_field = "django.db.models.BigAutoField"
6+
name = "mailing"
7+
verbose_name = "Рассылка"

mailing/constants.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
def get_default_mailing_schema() -> dict[str, dict[str, str]]:
2+
return {
3+
"title": {
4+
"title": "Заголовок письма",
5+
"default": "Рассылка | Procollab",
6+
},
7+
"text": {"title": "Основной текст письма"},
8+
"button_text": {"title": "Текст кнопки", "default": "Кнопка"},
9+
}

mailing/migrations/0001_initial.py

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Generated by Django 4.2.3 on 2023-09-30 09:44
2+
3+
import django.core.validators
4+
from django.db import migrations, models
5+
import mailing.models
6+
7+
8+
class Migration(migrations.Migration):
9+
10+
initial = True
11+
12+
dependencies = []
13+
14+
operations = [
15+
migrations.CreateModel(
16+
name="MailingSchema",
17+
fields=[
18+
(
19+
"id",
20+
models.BigAutoField(
21+
auto_created=True,
22+
primary_key=True,
23+
serialize=False,
24+
verbose_name="ID",
25+
),
26+
),
27+
("name", models.CharField(max_length=100)),
28+
("schema", models.JSONField()),
29+
(
30+
"template",
31+
models.FileField(
32+
upload_to=mailing.models.get_template_path,
33+
validators=[
34+
django.core.validators.FileExtensionValidator(
35+
allowed_extensions=["html"]
36+
)
37+
],
38+
),
39+
),
40+
],
41+
),
42+
]
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Generated by Django 4.2.3 on 2023-09-30 09:49
2+
3+
from django.db import migrations, models
4+
5+
6+
class Migration(migrations.Migration):
7+
8+
dependencies = [
9+
("mailing", "0001_initial"),
10+
]
11+
12+
operations = [
13+
migrations.AlterField(
14+
model_name="mailingschema",
15+
name="schema",
16+
field=models.JSONField(default=None, null=True),
17+
),
18+
]
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Generated by Django 4.2.3 on 2023-09-30 09:50
2+
3+
from django.db import migrations, models
4+
5+
6+
class Migration(migrations.Migration):
7+
8+
dependencies = [
9+
("mailing", "0002_alter_mailingschema_schema"),
10+
]
11+
12+
operations = [
13+
migrations.AlterField(
14+
model_name="mailingschema",
15+
name="schema",
16+
field=models.JSONField(blank=True, default="", null=True),
17+
),
18+
]
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Generated by Django 4.2.3 on 2023-09-30 09:51
2+
3+
from django.db import migrations, models
4+
5+
6+
class Migration(migrations.Migration):
7+
8+
dependencies = [
9+
("mailing", "0003_alter_mailingschema_schema"),
10+
]
11+
12+
operations = [
13+
migrations.AlterField(
14+
model_name="mailingschema",
15+
name="schema",
16+
field=models.JSONField(blank=True, default=dict, null=True),
17+
),
18+
]

0 commit comments

Comments
 (0)