0
0
Fork 0

Add List-Unsubscribe email header (#26085)

This commit is contained in:
Christian Schmidt 2023-08-01 19:34:40 +02:00 committed by GitHub
parent f2257069b2
commit ca342d4838
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 149 additions and 14 deletions

View file

@ -9,6 +9,8 @@ class MailSubscriptionsController < ApplicationController
before_action :set_user
before_action :set_type
protect_from_forgery with: :null_session
def show; end
def create
@ -20,6 +22,7 @@ class MailSubscriptionsController < ApplicationController
def set_user
@user = GlobalID::Locator.locate_signed(params[:token], for: 'unsubscribe')
not_found unless @user
end
def set_body_classes
@ -35,7 +38,7 @@ class MailSubscriptionsController < ApplicationController
when 'follow', 'reblog', 'favourite', 'mention', 'follow_request'
"notification_emails.#{params[:type]}"
else
raise ArgumentError
not_found
end
end
end