Tutte le view marketing, legali, viewer, dashboard e admin usano t(); mailer utente-facing e flash localizzati; admin con LocaleResolver e selettore lingua. Co-authored-by: Cursor <cursoragent@cursor.com>
41 lines
1.2 KiB
Ruby
41 lines
1.2 KiB
Ruby
module Recordings
|
|
class ReplayMailer < ApplicationMailer
|
|
default from: -> { MatchLiveTv.mail_from }
|
|
|
|
def replay_ready(recording:, recipient:)
|
|
@recording = recording
|
|
@team = recording.team
|
|
@club = @team.club
|
|
@recipient = recipient
|
|
@replay_url = recording.replay_url
|
|
@expires_at = recording.expires_at
|
|
@archive_url = "#{MatchLiveTv.app_public_url.chomp('/')}/clubs/#{@club.id}/replays"
|
|
|
|
I18n.with_locale(I18n.locale) do
|
|
mail(
|
|
to: recipient.email,
|
|
subject: t("mailers.replay_ready.subject", title: recording.title_or_default)
|
|
)
|
|
end
|
|
end
|
|
|
|
def replay_expiring_soon(recording:, recipient:)
|
|
@recording = recording
|
|
@team = recording.team
|
|
@club = @team.club
|
|
@recipient = recipient
|
|
@replay_url = recording.replay_url
|
|
@expires_at = recording.expires_at
|
|
@days_left = ((recording.expires_at - Time.current) / 1.day).ceil
|
|
@archive_url = "#{MatchLiveTv.app_public_url.chomp('/')}/clubs/#{@club.id}/replays"
|
|
|
|
I18n.with_locale(I18n.locale) do
|
|
mail(
|
|
to: recipient.email,
|
|
subject: t("mailers.replay_expiring.subject", days: @days_left, title: recording.title_or_default)
|
|
)
|
|
end
|
|
end
|
|
end
|
|
end
|