mirror of
https://github.com/docusealco/docuseal
synced 2026-11-04 14:42:32 -05:00
custom otp email
This commit is contained in:
1 parent
0905e7d215
commit
a847e7aa9c
2 files changed
+20
-2
No files matched your search
@@ -185,8 +185,16 @@ class SubmitterMailer < ApplicationMailer
|
|||||||
|
|
||||||
assign_message_metadata('otp_verification_email', submitter)
|
assign_message_metadata('otp_verification_email', submitter)
|
||||||
|
|
||||||
|
from =
|
||||||
|
if Docuseal.multitenant? &&
|
||||||
|
AccountConfig.exists?(account_id: submitter.account_id, key: 'custom_otp_email', value: true)
|
||||||
|
from_address_for_submitter(submitter)
|
||||||
|
else
|
||||||
|
default_params[:from]
|
||||||
|
end
|
||||||
|
|
||||||
I18n.with_locale(locale || submitter.account.locale) do
|
I18n.with_locale(locale || submitter.account.locale) do
|
||||||
mail(to: submitter.email, subject: I18n.t('email_verification'))
|
mail(to: submitter.email, from:, subject: I18n.t('email_verification'))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -9,6 +9,16 @@ class TemplateMailer < ApplicationMailer
|
|||||||
|
|
||||||
assign_message_metadata('otp_verification_email', template)
|
assign_message_metadata('otp_verification_email', template)
|
||||||
|
|
||||||
mail(to: email, subject: I18n.t('email_verification'))
|
from =
|
||||||
|
if Docuseal.multitenant? &&
|
||||||
|
AccountConfig.exists?(account_id: template.account_id, key: 'custom_otp_email', value: true)
|
||||||
|
put_metadata('from_user_id' => template.author_id)
|
||||||
|
|
||||||
|
template.author.friendly_name
|
||||||
|
else
|
||||||
|
default_params[:from]
|
||||||
|
end
|
||||||
|
|
||||||
|
mail(to: email, from:, subject: I18n.t('email_verification'))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
Reference in new issue
Block a user