emails: use separate addresses for different types of emails.
This commit is contained in:
@@ -5,24 +5,44 @@ class UserMailer < ApplicationMailer
|
||||
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")
|
||||
mail(
|
||||
@user,
|
||||
from: "#{Danbooru.config.canonical_app_name} <#{Danbooru.config.notification_email}>",
|
||||
subject: "#{Danbooru.config.canonical_app_name}: #{dmail.from.name} sent you a message",
|
||||
require_verified_email: true,
|
||||
)
|
||||
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")
|
||||
mail(
|
||||
@user,
|
||||
from: "#{Danbooru.config.canonical_app_name} <#{Danbooru.config.account_security_email}>",
|
||||
subject: "#{Danbooru.config.app_name} password reset request",
|
||||
require_verified_email: false,
|
||||
)
|
||||
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")
|
||||
mail(
|
||||
@user,
|
||||
from: "#{Danbooru.config.canonical_app_name} <#{Danbooru.config.account_security_email}>",
|
||||
subject: "Confirm your email address",
|
||||
require_verified_email: false,
|
||||
)
|
||||
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")
|
||||
mail(
|
||||
@user,
|
||||
from: "#{Danbooru.config.canonical_app_name} <#{Danbooru.config.welcome_user_email}>",
|
||||
subject: "Welcome to #{Danbooru.config.app_name}! Confirm your email address",
|
||||
require_verified_email: false,
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
# and add DANBOORU_ to the front. More examples:
|
||||
#
|
||||
# DANBOORU_CANONICAL_URL=https://booru.example.com
|
||||
# DANBOORU_CONTACT_EMAIL=admin@borou.example.com
|
||||
# DANBOORU_CONTACT_EMAIL=admin@booru.example.com
|
||||
# DANBOORU_DISCORD_SERVER_URL=https://discord.gg/yourbooru
|
||||
#
|
||||
# Settings from environment variables will override those from the config file.
|
||||
@@ -86,11 +86,26 @@ module Danbooru
|
||||
"http://#{Danbooru.config.hostname}"
|
||||
end
|
||||
|
||||
# Contact email address of the admin.
|
||||
# The email address of the admin user. This email will be publicly displayed on the contact page.
|
||||
def contact_email
|
||||
"webmaster@#{Danbooru.config.hostname}"
|
||||
end
|
||||
|
||||
# The email address to use for Dmail notifications.
|
||||
def notification_email
|
||||
"notifications@#{Danbooru.config.hostname}"
|
||||
end
|
||||
|
||||
# The email address to use for password reset and email verification emails.
|
||||
def account_security_email
|
||||
"security@#{Danbooru.config.hostname}"
|
||||
end
|
||||
|
||||
# The email address to use for new user signup emails.
|
||||
def welcome_user_email
|
||||
"welcome@#{Danbooru.config.hostname}"
|
||||
end
|
||||
|
||||
# System actions, such as sending automated dmails, will be performed with
|
||||
# this account. This account must have Moderator privileges.
|
||||
#
|
||||
|
||||
Reference in New Issue
Block a user