gpt4 book ai didi

ruby-on-rails - 设计可确认的,使用单独的电子邮件模板来重新确认电子邮件?

转载 作者:行者123 更新时间:2023-12-04 06:01:15 26 4
gpt4 key购买 nike

Devise 支持 reconfirmable 选项,当用户更改电子邮件时,他们必须确认新电子邮件。

但是使用标准的确认邮件模板。我想为必须重新确认的电子邮件使用单独的邮件模板。

设计的registrations_controller.rb:

  def update

self.resource = resource_class.to_adapter.get!(send(:"current_#{resource_name}").to_key)
prev_unconfirmed_email = resource.unconfirmed_email if resource.respond_to?(:unconfirmed_email)

if resource.update_with_password(resource_params)
if is_navigational_format?
flash_key = update_needs_confirmation?(resource, prev_unconfirmed_email) ?
:update_needs_confirmation : :updated
set_flash_message :notice, flash_key
end
sign_in resource_name, resource, :bypass => true
respond_with resource, :location => after_update_path_for(resource)
else
clean_up_passwords resource
respond_with resource
end
end

任何人都知道在哪里 Hook 到 Devise 让它使用单独的电子邮件文本来重新确认电子邮件,而不是使用默认的确认文本?

最佳答案

看看这个问题:

How to send two different emails for devise confirmable and devise reconfirmable?

您应该有权访问 @resource.pending_reconfirmation?在设计confirmation_instructions 邮件中。

关于ruby-on-rails - 设计可确认的,使用单独的电子邮件模板来重新确认电子邮件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16875782/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com