2023-05-21 17:59:36 +03:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
|
|
class UserMailer < ApplicationMailer
|
2023-10-11 21:05:42 +03:00
|
|
|
def invitation_email(user, invited_by: nil)
|
|
|
|
|
@current_account = invited_by&.account || user.account
|
2023-05-21 17:59:36 +03:00
|
|
|
@user = user
|
|
|
|
|
@token = @user.send(:set_reset_password_token)
|
|
|
|
|
|
2024-06-04 11:48:02 +03:00
|
|
|
assign_message_metadata('user_invitation', @user)
|
|
|
|
|
|
2024-10-01 21:18:01 +03:00
|
|
|
I18n.with_locale(@current_account.locale) do
|
|
|
|
|
mail(to: @user.friendly_name,
|
|
|
|
|
subject: I18n.t('you_are_invited_to_product_name', product_name: Docuseal.product_name))
|
|
|
|
|
end
|
2023-05-21 17:59:36 +03:00
|
|
|
end
|
|
|
|
|
end
|