Add unsubscribe link to e-mails (#25378)
This commit is contained in:
parent
dfaf59d99a
commit
6637ef7852
8 changed files with 106 additions and 11 deletions
|
@ -44,7 +44,11 @@
|
|||
%tbody
|
||||
%td.column-cell
|
||||
%p= t 'about.hosted_on', domain: site_hostname
|
||||
%p= link_to t('application_mailer.notification_preferences'), settings_preferences_notifications_url
|
||||
%p
|
||||
= link_to t('application_mailer.notification_preferences'), settings_preferences_notifications_url
|
||||
- if defined?(@type)
|
||||
·
|
||||
= link_to t('application_mailer.unsubscribe'), unsubscribe_url(token: @user.to_sgid(for: 'unsubscribe').to_s, type: @type)
|
||||
%td.column-cell.text-right
|
||||
= link_to root_url do
|
||||
= image_tag full_pack_url('media/images/mailer/logo.png'), alt: 'Mastodon', height: 24
|
||||
|
|
9
app/views/mail_subscriptions/create.html.haml
Normal file
9
app/views/mail_subscriptions/create.html.haml
Normal file
|
@ -0,0 +1,9 @@
|
|||
- content_for :page_title do
|
||||
= t('mail_subscriptions.unsubscribe.title')
|
||||
|
||||
.simple_form
|
||||
%h1.title= t('mail_subscriptions.unsubscribe.complete')
|
||||
%p.lead
|
||||
= t('mail_subscriptions.unsubscribe.success_html', domain: content_tag(:strong, site_hostname), type: content_tag(:strong, I18n.t(@type, scope: 'mail_subscriptions.unsubscribe.emails')), email: content_tag(:strong, @user.email))
|
||||
%p.lead
|
||||
= t('mail_subscriptions.unsubscribe.resubscribe_html', settings_path: settings_preferences_notifications_path)
|
12
app/views/mail_subscriptions/show.html.haml
Normal file
12
app/views/mail_subscriptions/show.html.haml
Normal file
|
@ -0,0 +1,12 @@
|
|||
- content_for :page_title do
|
||||
= t('mail_subscriptions.unsubscribe.title')
|
||||
|
||||
.simple_form
|
||||
%h1.title= t('mail_subscriptions.unsubscribe.title')
|
||||
%p.lead
|
||||
= t('mail_subscriptions.unsubscribe.confirmation_html', domain: content_tag(:strong, site_hostname), type: content_tag(:strong, I18n.t(@type, scope: 'mail_subscriptions.unsubscribe.emails')), email: content_tag(:strong, @user.email), settings_path: settings_preferences_notifications_path)
|
||||
|
||||
= form_tag unsubscribe_path, method: :post do
|
||||
= hidden_field_tag :token, params[:token]
|
||||
= hidden_field_tag :type, params[:type]
|
||||
= button_tag t('mail_subscriptions.unsubscribe.action'), type: :submit
|
Loading…
Add table
Add a link
Reference in a new issue