* Add header with the Danbooru name and logo. * Add footer with links to the site, the privacy policy, and the contact page. * Add "You received this email because of X" messages to remind users why they received the email. * Add basic CSS to make the design match the site.
29 lines
987 B
Ruby
29 lines
987 B
Ruby
# frozen_string_literal: true
|
|
|
|
class UserMailer < ApplicationMailer
|
|
# The email sent when a user receives a DMail.
|
|
def dmail_notice(dmail)
|
|
@dmail = dmail
|
|
@user = dmail.to
|
|
mail(@user, require_verified_email: true, subject: "#{Danbooru.config.app_name}: #{dmail.from.name} sent you a message")
|
|
end
|
|
|
|
# The email sent when a user requests a password reset.
|
|
def password_reset(user)
|
|
@user = user
|
|
mail(@user, require_verified_email: false, subject: "#{Danbooru.config.app_name} password reset request")
|
|
end
|
|
|
|
# The email sent when a user changes their email address.
|
|
def email_change_confirmation(user)
|
|
@user = user
|
|
mail(@user, require_verified_email: false, subject: "Confirm your email address")
|
|
end
|
|
|
|
# The email sent when a new user signs up with an email address.
|
|
def welcome_user(user)
|
|
@user = user
|
|
mail(@user, require_verified_email: false, subject: "Welcome to #{Danbooru.config.app_name}! Confirm your email address")
|
|
end
|
|
end
|