-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨ collect feedback after newsletter unsubscribe
- Loading branch information
Showing
11 changed files
with
281 additions
and
34 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
74 changes: 74 additions & 0 deletions
74
fragdenstaat_de/fds_newsletter/migrations/0005_unsubscribefeedback_and_more.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,74 @@ | ||
# Generated by Django 4.2.4 on 2024-05-13 12:45 | ||
|
||
import django.db.models.deletion | ||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
("fds_newsletter", "0004_alter_newslettercmsplugin_cmsplugin_ptr_and_more"), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name="UnsubscribeFeedback", | ||
fields=[ | ||
( | ||
"id", | ||
models.AutoField( | ||
auto_created=True, | ||
primary_key=True, | ||
serialize=False, | ||
verbose_name="ID", | ||
), | ||
), | ||
( | ||
"reason", | ||
models.CharField( | ||
choices=[ | ||
("too_much", "I received too many emails"), | ||
( | ||
"expected_updates", | ||
"I expected more updates regarding certain campaings", | ||
), | ||
( | ||
"specific_request", | ||
"I only signed up regarding a specific FOI request", | ||
), | ||
("not_interested", "The topics are not interesting to me"), | ||
("dislike", "I don't like your work anymore"), | ||
("other", "Other"), | ||
], | ||
max_length=50, | ||
), | ||
), | ||
("comment", models.TextField(blank=True)), | ||
("created", models.DateTimeField(auto_now_add=True)), | ||
( | ||
"newsletter", | ||
models.ForeignKey( | ||
on_delete=django.db.models.deletion.CASCADE, | ||
to="fds_newsletter.newsletter", | ||
), | ||
), | ||
( | ||
"subscriber", | ||
models.ForeignKey( | ||
blank=True, | ||
null=True, | ||
on_delete=django.db.models.deletion.CASCADE, | ||
to="fds_newsletter.subscriber", | ||
), | ||
), | ||
], | ||
options={ | ||
"verbose_name": "Newsletter Unsubscribe Feedback", | ||
}, | ||
), | ||
migrations.AddConstraint( | ||
model_name="unsubscribefeedback", | ||
constraint=models.UniqueConstraint( | ||
fields=("subscriber", "newsletter"), name="unique_feedback_subscriber" | ||
), | ||
), | ||
] |
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
16 changes: 16 additions & 0 deletions
16
fragdenstaat_de/fds_newsletter/templates/fds_newsletter/unsubscribe_feedback.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,16 @@ | ||
{% extends "base.html" %} | ||
{% load i18n %} | ||
{% load form_helper %} | ||
{% block app_body %} | ||
<h1> | ||
{% blocktrans %} | ||
You successfully unsubscribed from {{ newsletter }}. | ||
{% endblocktrans %} | ||
</h1> | ||
<p>{% trans "We'd love to know why you chose to unsubscribe." %}</p> | ||
<form method="post" action=""> | ||
{% csrf_token %} | ||
{% render_form form %} | ||
<input type="submit" class="btn btn-primary" value="{% trans "Submit" %}"> | ||
</form> | ||
{% endblock app_body %} |
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
Oops, something went wrong.