-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Creates a front draft when the first flight is launched for an advertiser. Also renames the user field for flight notifications to be more obvious. I do wonder if we should just have this notification for *all* flights instead of just the first one
- Loading branch information
1 parent
871ac5d
commit 0bade90
Showing
9 changed files
with
181 additions
and
12 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
27 changes: 27 additions & 0 deletions
27
adserver/auth/migrations/0007_rename_flight_notifications.py
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,27 @@ | ||
# Generated by Django 5.0.7 on 2024-08-16 22:00 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
("adserver_auth", "0006_simple_history_upgrade"), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name="historicaluser", | ||
name="flight_notifications", | ||
field=models.BooleanField( | ||
default=True, help_text="Receive email notification about ad flights" | ||
), | ||
), | ||
migrations.AddField( | ||
model_name="user", | ||
name="flight_notifications", | ||
field=models.BooleanField( | ||
default=True, help_text="Receive email notification about ad flights" | ||
), | ||
), | ||
] |
23 changes: 23 additions & 0 deletions
23
adserver/auth/migrations/0008_data_flight_notifications.py
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,23 @@ | ||
# Generated by Django 5.0.7 on 2024-08-16 22:01 | ||
|
||
from django.db import migrations | ||
|
||
|
||
def forwards(apps, schema_editor): | ||
"""Update flight notifications field.""" | ||
User = apps.get_model("adserver_auth", "User") | ||
|
||
for user in User.objects.all(): | ||
user.flight_notifications = user.notify_on_completed_flights | ||
user.save() | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
("adserver_auth", "0007_rename_flight_notifications"), | ||
] | ||
|
||
operations = [ | ||
migrations.RunPython(forwards, reverse_code=migrations.RunPython.noop) | ||
] |
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,30 @@ | ||
{% extends 'adserver/email/advertiser-base.html' %} | ||
{% load i18n %} | ||
|
||
|
||
{% block content %} | ||
<p>{% blocktrans with advertiser_name=advertiser.name %}{{ advertiser_name }} team,{% endblocktrans %}</p> | ||
|
||
<p>{% blocktrans with site_name=site.name %}Congrats on launching your first ad flight with {{ site_name }}!{% endblocktrans %}</p> | ||
|
||
{% spaceless %} | ||
|
||
<p>{% blocktrans with total_flights=flights|length pluralized_flights=flights|length|pluralize %} | ||
You have {{ total_flights }} flight{{ pluralized_flights }} that launched today. | ||
Below are links to your flight{{ pluralized_flights }} and performance reports in our ad dashboard: | ||
{% endblocktrans %}</p> | ||
<ul> | ||
{% for flight in flights %} | ||
{% url "flight_report" advertiser.slug flight.slug as flight_report_url %} | ||
<li> | ||
<a href="{{ site.domain }}{{ flight.get_absolute_url }}?ref=email-flight-launched">{{ flight.name }}</a> | ||
<span> (<a href="{{ site.domain }}{{ flight_report_url }}?ref=email-flight-launched">{% trans 'report' %}</a>)</span> | ||
</li> | ||
{% endfor %} | ||
</ul> | ||
|
||
<p>{% blocktrans %}Thanks for advertising with us and don't hesitate to let us know if there's anything we can do to help make advertising with us a success for you.{% endblocktrans %}</p> | ||
|
||
{% endspaceless %} | ||
|
||
{% endblock content %} |
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