discourse/app/views/user_notifications/digest/_footer.text.erb
Isaac Janzen 4c0367f774
DEV: Strip unsubscribe links when sending digest previews to arbitrary addresses (#38298)
# Problem

When an admin sends a digest preview to an arbitrary email address, the
email contained functional unsubscribe links belonging to the target
user, allowing the recipient to unsubscribe that user without their
consent.

# Solution

Pass `skip_unsubscribe_links: true` when generating preview digests,
which skips `UnsubscribeKey` creation and suppresses unsubscribe content
from both email headers and body templates at the source.
2026-03-05 13:58:51 -06:00

15 lines
No EOL
635 B
Text

<%- site_link = raw(@markdown_linker.create(@site_name, '/')) %>
<%= raw(@markdown_linker.references) %>
<%= digest_custom_text("above_footer") %>
<%- if @unsubscribe_key %>
<%=raw(t :'user_notifications.digest.unsubscribe',
site_link: site_link,
email_preferences_link: raw(@markdown_linker.create(t('user_notifications.digest.your_email_settings'), '/my/preferences/emails')),
unsubscribe_link: raw(@markdown_linker.create(t('user_notifications.digest.click_here'), "/email/unsubscribe/#{@unsubscribe_key}"))) %>
<%- end %>
<%= raw(@markdown_linker.references) %>
<%= digest_custom_text("below_footer") %>