【问题标题】:Devise reconfirmable, use a separate mail template for reconfirmation emails?设计可再确认,使用单独的邮件模板进行再确认电子邮件?
【发布时间】:2013-06-01 18:16:00
【问题描述】:

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

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

设计的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

有谁知道在哪里连接到 Devise,让它使用单独的电子邮件文本来发送可重新确认的电子邮件,而不是使用默认的确认文本?

【问题讨论】:

    标签: ruby-on-rails ruby-on-rails-3 devise actionmailer confirmation


    【解决方案1】:

    看看这个问题:

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

    您应该可以在设计确认说明邮件中访问@resource.pending_reconfirmation?

    【讨论】:

      猜你喜欢
      • 2013-03-24
      • 1970-01-01
      • 2011-08-22
      • 1970-01-01
      • 1970-01-01
      • 2012-03-10
      • 1970-01-01
      • 1970-01-01
      • 2020-06-03
      相关资源
      最近更新 更多