You can override options[:template_name] in the #confirmation_instructions method of your mailer.class AuthMailer < Devise::Mailer helper :application include Devise::Controllers::UrlHelpers default template_path: 'devise/mailer' def confirmation_instructions(record, token, options={}) # Use different e-mail templates for signup e-mail confirmation and for when a user changes e-mail address. if record.pending_reconfirmation? options[:template_name] = 'reconfirmation_instructions' else options[:template_name] = 'confirmation_instructions' end super endend也请从device.rb更改此行Also change this line from device.rb# config.mailer = 'Devise::Mailer'config.mailer = 'AuthMailer' 这篇关于如何发送两个不同的电子邮件以进行可确认的设计和可确认的设计?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!
10-27 16:10