parent
c0bbd01926
commit
7d083bb534
10 changed files with 165 additions and 11 deletions
@ -0,0 +1,32 @@ |
||||
from django.core.management.base import BaseCommand |
||||
|
||||
from apps.notification.tasks import send_camp_certificates |
||||
|
||||
|
||||
class Command(BaseCommand): |
||||
help = 'Send camp certificates at the end of month' |
||||
|
||||
def add_arguments(self, parser): |
||||
# Named (optional) arguments |
||||
parser.add_argument( |
||||
'--email', |
||||
dest='email', |
||||
help='Test email', |
||||
) |
||||
parser.add_argument( |
||||
'--cert', |
||||
dest='certificate_number', |
||||
type=int, |
||||
help='Certificate number', |
||||
) |
||||
parser.add_argument( |
||||
'--dry-run', |
||||
action='store_true', |
||||
dest='dry_run', |
||||
help='Only display emails', |
||||
) |
||||
|
||||
def handle(self, *args, **options): |
||||
send_camp_certificates(email=options.get('email'), certificate_number=options.get('certificate_number'), |
||||
dry_run=options.get('dry_run')) |
||||
|
||||
@ -0,0 +1,18 @@ |
||||
# Generated by Django 2.0.7 on 2019-05-23 01:53 |
||||
|
||||
from django.db import migrations, models |
||||
|
||||
|
||||
class Migration(migrations.Migration): |
||||
|
||||
dependencies = [ |
||||
('notification', '0001_initial'), |
||||
] |
||||
|
||||
operations = [ |
||||
migrations.AddField( |
||||
model_name='usernotification', |
||||
name='camp_certificate_last_email', |
||||
field=models.DateTimeField(blank=True, null=True), |
||||
), |
||||
] |
||||
@ -0,0 +1,25 @@ |
||||
{% extends "notification/email/_base.html" %} |
||||
|
||||
{% block content %} |
||||
<p style="margin: 0 0 20px">Привет!</p> |
||||
<div style="margin-bottom: 10px;"> |
||||
{% if certificate_number == 1 %} |
||||
<p> |
||||
Поздравляем! Вы прошли месяц обучения в лагере Lil School.<br> |
||||
К письму прикреплена грамота. Распечатайте её и вручите вашим детям.<br> |
||||
Ждём вас в следующем месяце на наших творческих занятиях! |
||||
</p> |
||||
{% endif %} |
||||
{% if certificate_number == 2 %} |
||||
<p> |
||||
Вы помните, что каждый месяц вам приходит грамота за прекрасную учебу в рсиовальном лагере?<br> |
||||
Скачивайте. Распечатывайте. И соберите свою коллекцию! |
||||
</p> |
||||
{% endif %} |
||||
</div> |
||||
<div style="margin-bottom: 10px;"> |
||||
<p> |
||||
Команда «Lil School». |
||||
</p> |
||||
</div> |
||||
{% endblock content %} |
||||
|
After Width: | Height: | Size: 473 KiB |
|
After Width: | Height: | Size: 1.3 MiB |
Loading…
Reference in new issue