summaryrefslogtreecommitdiffstats
path: root/templates/patchwork/profile.html
diff options
context:
space:
mode:
authorJeremy Kerr <jk@ozlabs.org>2010-08-11 14:16:28 +0800
committerJeremy Kerr <jk@ozlabs.org>2011-04-14 17:23:04 +0800
commit41f19b6643b44768dc06561c992c04ed6148477d (patch)
tree6f1c3d1fbe5e15e53d3c028a8e654f05b19e68fb /templates/patchwork/profile.html
parentc2c6a408c7764fa29389ce160f52776c9308d50a (diff)
downloadpatchwork-41f19b6643b44768dc06561c992c04ed6148477d.tar.bz2
patchwork-41f19b6643b44768dc06561c992c04ed6148477d.tar.xz
Add email opt-out system
We're going to start generating emails on patchwork updates, so firstly allow people to opt-out of all patchwork communications. We do this with a 'mail settings' interface, allowing non-registered users to set preferences on their email address. Logged-in users can do this through the user profile view. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Diffstat (limited to 'templates/patchwork/profile.html')
-rw-r--r--templates/patchwork/profile.html36
1 files changed, 26 insertions, 10 deletions
diff --git a/templates/patchwork/profile.html b/templates/patchwork/profile.html
index 44df921..130b947 100644
--- a/templates/patchwork/profile.html
+++ b/templates/patchwork/profile.html
@@ -40,34 +40,50 @@ Contributor to
<p>The following email addresses are associated with this patchwork account.
Adding alternative addresses allows patchwork to group contributions that
you have made under different addresses.</p>
+<p>The "notify?" column allows you to opt-in or -out of automated
+patchwork notification emails. Setting it to "no" will disable automated
+notifications for that address.</p>
<p>Adding a new email address will send a confirmation email to that
address.</p>
-<table class="vertical" style="width: 20em;">
+<table class="vertical">
<tr>
<th>email</th>
- <th/>
- </tr>
- <tr>
- <td>{{ user.email }}</td>
- <td></td>
+ <th>action</th>
+ <th>notify?</th>
</tr>
{% for email in linked_emails %}
- {% ifnotequal email.email user.email %}
<tr>
<td>{{ email.email }}</td>
<td>
- {% ifnotequal user.email email.email %}
+ {% ifnotequal user.email email.email %}
<form action="{% url patchwork.views.user.unlink person_id=email.id %}"
method="post">
{% csrf_token %}
<input type="submit" value="Unlink"/>
</form>
{% endifnotequal %}
+ </td>
+ <td>
+ {% if email.is_optout %}
+ <form method="post" action="{% url patchwork.views.mail.optin %}">
+ No,
+ {% csrf_token %}
+ <input type="hidden" name="email" value="{{email.email}}"/>
+ <input type="submit" value="Opt-in"/>
+ </form>
+ {% else %}
+ <form method="post" action="{% url patchwork.views.mail.optout %}">
+ Yes,
+ {% csrf_token %}
+ <input type="hidden" name="email" value="{{email.email}}"/>
+ <input type="submit" value="Opt-out"/>
+ </form>
+ {% endif %}
+ </td>
</tr>
- {% endifnotequal %}
{% endfor %}
<tr>
- <td colspan="2">
+ <td colspan="3">
<form action="{% url patchwork.views.user.link %}" method="post">
{% csrf_token %}
{{ linkform.email }}