-
Notifications
You must be signed in to change notification settings - Fork 0
/
template.html
87 lines (85 loc) · 4.16 KB
/
template.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
<!DOCTYPE html>
<html>
<head>
<title>Unsubscribe --</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/5.2.0/css/bootstrap.min.css">
<link rel="stylesheet" href="https://cdn.datatables.net/1.13.3/css/dataTables.bootstrap5.min.css">
<style>
:root {
--bs-body-font-size: .8rem;
}
</style>
</head>
<body>
<div class="container">
<header class="mb-3 border-bottom">
<a href="/" class="d-flex align-items-center text-dark text-decoration-none">
<img src="https://raw.githubusercontent.com/luarmr/gmail_unsubscribe/main/assets/logo.png" height="60px" alt="Unsubscribe --" class="m-1" />
</a>
</header>
<div class="alert alert-warning alert-dismissible fade show" role="alert">
<p>
We do not have a list of all unsubscribe emails. Instead, our app accesses your email and flags emails that contain a link to an unsubscribe action. We group them by sender, after that it is a manual process.
</p>
<p>
False positives may occur. We may show you a link "unsubscribe" with wrong information.
</p>
<p>
After unsubscribe, you can use the link to a search that make easy to delete all emails. If you choose to keep the emails, they will be shown in the results next time you execute the script. But you can use labels and <code>--extra-search-params</code> to exclude them
</p>
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
</div>
<p><strong>{{ context.total_messages }}</strong> emails founded. From <strong>{{ context.groups|length }}</strong> different senders.</p>
<table id="myTable" class="table table-striped table-bordered table-hover">
<thead>
<tr>
<th>Count</th>
<th>Sender</th>
<th>Title</th>
<th>Last email</th>
<th>Unsubscribe</th>
<th>See emails</th>
</tr>
</thead>
<tbody>
{% for row in context.groups %}
<tr>
<td>{{row['count']}}</td>
<td><strong>{{row['sender_name']}}</strong><br /><em>{{row['sender_email']}}</em></td>
<td><a href="https://mail.google.com/mail/u/0/#inbox/{{row['id']}}" target="_blank">{{row['title']}}</a></td>
<td>{{row['last_email_date']}}</td>
<td>
{% if row['unsubscribe_link'] %}<a href="{{row['unsubscribe_link']}}" target="_blank">Link</a>{% endif %}
{% if row['unsubscribe_link'] and row['unsubscribe_email'] %}<br />{% endif %}
{% if row['unsubscribe_email'] %}<a href="{{row['unsubscribe_email']}}" target="_blank">Email</a>{% endif %}
{% if not row['unsubscribe_link'] and not row['unsubscribe_email'] %} - {% endif %}
</td>
<td><a href="https://mail.google.com/mail/u/0/#search/from%3A({{row['sender_email']}})" target="_blank">GMail search</a></td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
<script src="https://code.jquery.com/jquery-3.5.1.js"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/js/bootstrap.bundle.min.js"></script>
<script src="https://cdn.datatables.net/1.13.3/js/jquery.dataTables.min.js"></script>
<script src="https://cdn.datatables.net/1.13.3/js/dataTables.bootstrap5.min.js"></script>
<script>
$(document).ready(function() {
$('#myTable').DataTable({
'order': [[ 0, 'desc' ]],
'columnDefs': [
{
'targets': [ 5 ],
'orderable': false
},
{ "width": "30%", "targets": [1,2] },
{ "width": "0%", "targets": [0] }
]
});
})
</script>
</body>
</html>