eBooru/app/mailers/user_mailer.rb
Earlopain fc7d84affd
[RuboCop] Enable Style/FrozenStringLiteralComment
This reduces allocations on the posts page by about 5%, from basic testing
2024-02-25 18:15:55 +01:00

20 lines
664 B
Ruby

# frozen_string_literal: true
class UserMailer < ActionMailer::Base
helper ApplicationHelper
helper UsersHelper
default :from => Danbooru.config.mail_from_addr, :content_type => "text/html"
def dmail_notice(dmail)
@dmail = dmail
mail(:to => "#{dmail.to.name} <#{dmail.to.email}>", :subject => "#{Danbooru.config.app_name} - Message received from #{dmail.from.name}")
end
def forum_notice(user, forum_topic, forum_posts)
@user = user
@forum_topic = forum_topic
@forum_posts = forum_posts
mail(:to => "#{user.name} <#{user.email}>", :subject => "#{Danbooru.config.app_name} forum topic #{forum_topic.title} updated")
end
end