Some checks are pending
NordaBiz Tests / Unit & Integration Tests (push) Waiting to run
NordaBiz Tests / E2E Tests (Playwright) (push) Blocked by required conditions
NordaBiz Tests / Smoke Tests (Production) (push) Blocked by required conditions
NordaBiz Tests / Send Failure Notification (push) Blocked by required conditions
Każdy e-mail powiadomieniowy ma teraz:
(1) link w stopce "Wyłącz ten typ powiadomień jednym kliknięciem"
(2) nagłówki List-Unsubscribe + List-Unsubscribe-Post dla klientów
pocztowych (Gmail/Apple Mail pokażą natywny przycisk Unsubscribe)
Implementacja:
- utils/unsubscribe_tokens.py: signed token (itsdangerous, SECRET_KEY)
niosący user_id + notification_type, bez wygasania
- blueprints/unsubscribe: GET /unsubscribe?t=TOKEN → strona potwierdzenia,
POST /unsubscribe → faktyczne wyłączenie flagi notify_email_<type>
- email_service.send_email() dostał parametr notification_type. Jeśli
przekazany razem z user_id, footer + headery są doklejane
- Aktualizowane wywołania: message_notification (messages),
classified_question/answer (B2B Q&A), classified_expiry (skrypt cron)
Prefetch safety: GET pokazuje stronę z przyciskiem "Tak, wyłącz",
wyłączenie następuje po POST. RFC 8058 One-Click (POST bez formularza
z Content-Type application/x-www-form-urlencoded + body
"List-Unsubscribe=One-Click") obsługuje klientów pocztowych.
D.2/D.3 dorzucą kolejne notification_type (forum, broadcast, events).
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
65 lines
4.0 KiB
HTML
65 lines
4.0 KiB
HTML
{% extends "base.html" %}
|
|
|
|
{% block title %}Wyłączanie powiadomień e-mail — Norda Biznes{% endblock %}
|
|
|
|
{% block content %}
|
|
<div style="max-width:560px; margin:40px auto; background:#fff; border-radius:12px; padding:40px 32px; box-shadow:0 2px 8px rgba(0,0,0,0.06); text-align:center">
|
|
|
|
{% if status == 'confirm' %}
|
|
<svg width="48" height="48" fill="none" stroke="#233e6d" stroke-width="2" viewBox="0 0 24 24" style="margin-bottom:16px">
|
|
<path stroke-linecap="round" stroke-linejoin="round" d="M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"/>
|
|
</svg>
|
|
<h1 style="font-size:22px; color:#233e6d; margin:0 0 12px">Wyłączyć ten typ powiadomień?</h1>
|
|
<p style="color:#555; line-height:1.5; margin-bottom:24px">
|
|
Chcesz wyłączyć e-maile tego typu:<br>
|
|
<strong style="color:#1f2937">{{ label }}</strong>
|
|
</p>
|
|
<p style="color:#6b7280; font-size:13px; line-height:1.5; margin-bottom:24px">
|
|
Powiadomienia w portalu i na urządzeniu (push) pozostaną bez zmian.
|
|
Preferencje możesz w każdej chwili zmienić w panelu konta → Prywatność.
|
|
</p>
|
|
<form method="POST" action="{{ url_for('unsubscribe.unsubscribe_apply') }}" style="margin:0">
|
|
<input type="hidden" name="t" value="{{ token }}">
|
|
<button type="submit" style="background:#dc2626; color:#fff; border:none; padding:12px 28px; border-radius:8px; font-size:15px; font-weight:500; cursor:pointer">
|
|
Tak, wyłącz te powiadomienia
|
|
</button>
|
|
<div style="margin-top:16px">
|
|
<a href="/" style="color:#6b7280; font-size:13px; text-decoration:none">Anuluj i wróć na portal</a>
|
|
</div>
|
|
</form>
|
|
|
|
{% elif status == 'done' %}
|
|
<svg width="56" height="56" fill="none" stroke="#10b981" stroke-width="2" viewBox="0 0 24 24" style="margin-bottom:16px">
|
|
<path stroke-linecap="round" stroke-linejoin="round" d="M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z"/>
|
|
</svg>
|
|
<h1 style="font-size:22px; color:#10b981; margin:0 0 12px">Powiadomienia wyłączone</h1>
|
|
<p style="color:#555; line-height:1.5; margin-bottom:24px">
|
|
Nie będziesz już otrzymywać e-maili typu <strong>{{ label }}</strong>.
|
|
</p>
|
|
<p style="color:#6b7280; font-size:13px; line-height:1.5; margin-bottom:24px">
|
|
Przypomnienia na urządzeniu (push) i powiadomienia w portalu działają bez zmian.
|
|
Aby przywrócić ten typ e-maili, wejdź w panel konta.
|
|
</p>
|
|
<a href="{{ url_for('auth.konto_prywatnosc') if current_user.is_authenticated else '/login' }}"
|
|
style="display:inline-block; background:#233e6d; color:#fff; padding:10px 20px; border-radius:8px; font-size:14px; text-decoration:none">
|
|
Zarządzaj ustawieniami powiadomień
|
|
</a>
|
|
|
|
{% else %}
|
|
<svg width="48" height="48" fill="none" stroke="#dc2626" stroke-width="2" viewBox="0 0 24 24" style="margin-bottom:16px">
|
|
<path stroke-linecap="round" stroke-linejoin="round" d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"/>
|
|
</svg>
|
|
<h1 style="font-size:22px; color:#dc2626; margin:0 0 12px">Link nieprawidłowy</h1>
|
|
<p style="color:#555; line-height:1.5; margin-bottom:24px">
|
|
Ten link nie działa — mógł zostać uszkodzony lub już wykorzystany.<br>
|
|
Zaloguj się i zmień ustawienia powiadomień w panelu konta.
|
|
</p>
|
|
<a href="{{ url_for('auth.konto_prywatnosc') if current_user.is_authenticated else '/login' }}"
|
|
style="display:inline-block; background:#233e6d; color:#fff; padding:10px 20px; border-radius:8px; font-size:14px; text-decoration:none">
|
|
Przejdź do ustawień
|
|
</a>
|
|
{% endif %}
|
|
|
|
</div>
|
|
{% endblock %}
|