2024-04-29 00:17:15 +02:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2024-01-23 17:21:30 +01:00
|
|
|
# Preview all emails at http://localhost:3000/rails/mailers/api_token_mailer
|
|
|
|
class APITokenMailer < ApplicationMailer
|
|
|
|
helper MailerHelper
|
|
|
|
|
|
|
|
layout 'mailers/layout'
|
|
|
|
|
|
|
|
def expiration(api_token)
|
|
|
|
@api_token = api_token
|
|
|
|
user = api_token.administrateur.user
|
2024-03-26 17:23:42 +01:00
|
|
|
subject = "Votre jeton d'accès à la plateforme #{Current.application_name} expire le #{l(@api_token.expires_at, format: :long)}"
|
2024-01-23 17:21:30 +01:00
|
|
|
|
|
|
|
mail(to: user.email, subject:)
|
|
|
|
end
|
|
|
|
|
|
|
|
def self.critical_email?(action_name)
|
|
|
|
false
|
|
|
|
end
|
|
|
|
end
|