Skip to main content

max / makenotwork

3.7 KB · 77 lines History Blame Raw
1 {% extends "base.html" %}
2 {% block title %}Email preferences - Makenotwork{% endblock %}
3 {% block body_attrs %} class="{{ crate::shell::measure(crate::shell::Measure::Contained) }}"{% endblock %}
4 {% block content %}
5 {# Reached from a signed link in an email, with no session. Every form here
6 carries the same token the page did, because that token is the
7 authorisation: asking somebody to log in before they can stop receiving
8 email is how "unsubscribe" turns into "mark as spam".
9
10 GET renders. Nothing on this page mutates without a POST, so a mail client
11 or link scanner prefetching the URL cannot unsubscribe anyone. #}
12 <div class="email-result-wrap prefs-wrap">
13 <h1 class="brand-h1">Email preferences</h1>
14
15 {% if subscriptions.is_empty() %}
16 <p>This address is not subscribed to anything.</p>
17 {% else %}
18 <p>Choose what you hear about. Changes take effect immediately.</p>
19
20 <ul class="prefs-list">
21 {% for sub in subscriptions %}
22 <li class="prefs-row{% if sub.subscription_id == origin_subscription %} prefs-row--origin{% endif %}">
23 <span class="prefs-name">{{ sub.title }}
24 {%- if let Some(owner) = sub.owner_name %}
25 {# Who decided this mail, said on the row it belongs to. A
26 project list has two parties behind it and the subscriber
27 should not have to guess which one wrote to them. #}
28 <span class="prefs-owner">Sent by {{ owner }}</span>
29 {%- endif %}
30 </span>
31 {% if sub.required %}
32 {# Receipts, security and account mail. Listed so the page is an
33 honest inventory of what we send, with no toggle, because there
34 is no opting out of a receipt. #}
35 <span class="prefs-required">Always sent</span>
36 {% else %}
37 <form method="post" action="/unsubscribe/list" class="inline-form">
38 <input type="hidden" name="sub" value="{{ token }}">
39 <input type="hidden" name="sig" value="{{ signature }}">
40 <input type="hidden" name="target" value="{{ sub.subscription_id }}">
41 {% if sub.subscribed() %}
42 <input type="hidden" name="action" value="unsubscribe">
43 <button type="submit" class="btn-secondary">Unsubscribe</button>
44 {% else %}
45 <input type="hidden" name="action" value="resubscribe">
46 <button type="submit" class="btn-secondary">Resubscribe</button>
47 {% endif %}
48 </form>
49 {% endif %}
50 </li>
51 {% endfor %}
52 </ul>
53
54 <form method="post" action="/unsubscribe/all" class="prefs-all">
55 <input type="hidden" name="sub" value="{{ token }}">
56 <input type="hidden" name="sig" value="{{ signature }}">
57 <button type="submit" class="btn-primary">Unsubscribe from everything</button>
58 </form>
59 {% endif %}
60
61 {# Article 26 attribution. A subscriber landing here from a creator's mail
62 has two parties holding their address, and the page is where they find
63 out who, and that one contact answers for both. #}
64 <p class="prefs-attribution">
65 Makenotwork holds your address and sends this mail. For a project list,
66 the creator who owns it decides who is on it and what it says, which
67 makes us joint controllers of your address. One contact answers for
68 both of us: <a href="mailto:privacy@makenot.work">privacy@makenot.work</a>.
69 The full arrangement is on the
70 <a href="/docs/mailing-list-data-processing">Mailing List Data Processing</a>
71 page.
72 </p>
73
74 <p><a href="/">Back to Makenotwork</a></p>
75 </div>
76 {% endblock %}
77