28 lines
870 B
Ruby
28 lines
870 B
Ruby
module Tournaments
|
|
class InvitationMailer < ApplicationMailer
|
|
default from: -> { MatchLiveTv.mail_from }
|
|
|
|
def transmission_invite(tournament:, invitation:, invite_url:, invited_by:, body_html: nil)
|
|
@tournament = tournament
|
|
@club = tournament.club
|
|
@invitation = invitation
|
|
@invite_url = invite_url
|
|
@invited_by = invited_by
|
|
@expires_on = I18n.l(invitation.expires_at.to_date, format: :long)
|
|
@body_html = body_html.presence || invitation.email_html.presence
|
|
@body_text = ActionController::Base.helpers.strip_tags(@body_html.to_s).squish
|
|
|
|
I18n.with_locale(I18n.locale) do
|
|
mail(
|
|
to: invitation.email,
|
|
subject: t(
|
|
"mailers.tournament_invite.subject",
|
|
tournament: @tournament.name,
|
|
club: @club.name
|
|
)
|
|
)
|
|
end
|
|
end
|
|
end
|
|
end
|