class ContactMailer < ApplicationMailer def inquiry(name:, email:, club_name:, topic:, message:) @name = name @email = email @club_name = club_name.presence @topic = topic @message = message mail( to: recipient_for(topic), reply_to: email, subject: t("mailers.contact.subject.#{topic}", name: name) ) end private def recipient_for(topic) if topic == "privacy" MatchLiveTv.privacy_controller_email else MatchLiveTv.support_email end end end