forked from GithubBackups/healthchecks
Report unsubscribe link works with POST. Include "X-Bounce-Url" header in report emails.
This commit is contained in:
parent
df86fd29b3
commit
9f02371d6a
@ -152,7 +152,11 @@ class Profile(models.Model):
|
|||||||
|
|
||||||
unsub_url = self.reports_unsub_url()
|
unsub_url = self.reports_unsub_url()
|
||||||
|
|
||||||
headers = {"List-Unsubscribe": unsub_url}
|
headers = {
|
||||||
|
"List-Unsubscribe": unsub_url,
|
||||||
|
"X-Bounce-Url": unsub_url
|
||||||
|
}
|
||||||
|
|
||||||
ctx = {
|
ctx = {
|
||||||
"checks": checks,
|
"checks": checks,
|
||||||
"sort": self.sort,
|
"sort": self.sort,
|
||||||
|
@ -13,6 +13,7 @@ from django.core import signing
|
|||||||
from django.http import HttpResponseForbidden, HttpResponseBadRequest
|
from django.http import HttpResponseForbidden, HttpResponseBadRequest
|
||||||
from django.shortcuts import redirect, render
|
from django.shortcuts import redirect, render
|
||||||
from django.utils.timezone import now
|
from django.utils.timezone import now
|
||||||
|
from django.views.decorators.csrf import csrf_exempt
|
||||||
from django.views.decorators.http import require_POST
|
from django.views.decorators.http import require_POST
|
||||||
from hc.accounts.forms import (ChangeEmailForm, EmailPasswordForm,
|
from hc.accounts.forms import (ChangeEmailForm, EmailPasswordForm,
|
||||||
InviteTeamMemberForm, RemoveTeamMemberForm,
|
InviteTeamMemberForm, RemoveTeamMemberForm,
|
||||||
@ -344,6 +345,7 @@ def change_email_done(request):
|
|||||||
return render(request, "accounts/change_email_done.html")
|
return render(request, "accounts/change_email_done.html")
|
||||||
|
|
||||||
|
|
||||||
|
@csrf_exempt
|
||||||
def unsubscribe_reports(request, username):
|
def unsubscribe_reports(request, username):
|
||||||
signer = signing.TimestampSigner(salt="reports")
|
signer = signing.TimestampSigner(salt="reports")
|
||||||
try:
|
try:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user