Fix it so that emails are (hopefully) able to show the one-click unsubscribe button in Gmail and other mail providers that support the List-Unsubscribe header. This way users can unsubscribe instead of marking emails as spam. * Add the List-Unsubscribe-Post header. * Fix the disable email notifications endpoint to support POST as well as DELETE requests. * Fix the disable email notifications endpoint to disable XSRF protection (we don't need users to be logged in because we use a signed URL instead). https://www.rfc-editor.org/rfc/rfc8058#section-3.1 https://www.rfc-editor.org/rfc/rfc8058#section-8.1
Mailers
This directory contains mailers for sending emails. Mailers are kind of like controllers, except for generating emails instead of generating HTML.
The actual email templates live in app/views/user_mailer.
Emails are sent asynchronously using a background job. If sending the email fails, it will be retried later.
Sending emails requires a SMTP server to be configured in config/danbooru_local_config.rb. In production, Amazon SES is used to send emails.
Email templates can be previewed at http://localhost:3000/rails/mailers (assuming you're running bin/rails server on
port 3000, the default).
Example
UserMailer.welcome_user(@user).deliver_later