Ruby on rails 如何避免发送确认电子邮件?

Ruby on rails 如何避免发送确认电子邮件?,ruby-on-rails,devise,devise-confirmable,devise-invitable,Ruby On Rails,Devise,Devise Confirmable,Devise Invitable,从文件来看,我认为它不应该发送确认电子邮件,但它正在这样做 以下是我对不可侵犯操作的设置: class Users::InvitationsController < Devise::InvitationsController def multiple_create if params[:multiple_emails].blank? build_resource render :new, notice: "something went wrong"

从文件来看,我认为它不应该发送确认电子邮件,但它正在这样做

以下是我对不可侵犯操作的设置:

class Users::InvitationsController < Devise::InvitationsController

def multiple_create
    if params[:multiple_emails].blank?
        build_resource
        render :new, notice: "something went wrong"
    else
        params[:multiple_emails].each do |email|
            User.invite!({email: email}, current_user) # current_user will be set as invited_by
        end
        if current_user.errors.empty?
            set_flash_message :notice, :send_instructions, :email => params[:multiple_emails]
            respond_with current_user, :location => after_invite_path_for(current_user)
        else
            respond_with_navigational(current_user) { render :new }
        end
    end
end
end
class用户::invitationcontrollerparams[:多封电子邮件]
使用当前用户响应(当前用户):位置=>在(当前用户)的邀请路径之后
其他的
使用导航(当前用户){render:new}响应
结束
结束
结束
结束

为了避免设计确认邮件,您必须从用户模型中排除
:confirmable
选项

例如,更改:

 class User  
   devise :registerable, :confirmable
 end  
致:


为了避免设计确认邮件,您必须从用户模型中排除
:confirmable
选项

例如,更改:

 class User  
   devise :registerable, :confirmable
 end  
致:

上的文档非常清楚如何跳过发送邀请电子邮件。查看用法下的第二个代码段,前面有以下文本:

如果要创建邀请但不发送邀请,可以设置 跳过邀请到true

上的文档非常清楚如何跳过发送邀请电子邮件。查看用法下的第二个代码段,前面有以下文本:

如果要创建邀请但不发送邀请,可以设置 跳过邀请到true


对于必须使用
:confirmable
进行用户注册并希望避免发送带有邀请的确认信的情况:

class用户
对于必须使用
:confirmable
进行用户注册并希望避免发送带有邀请的确认信的情况:

class用户
我昨天添加了一个答案,我不知道答案在哪里!我希望它跳过确认邮件,而不是邀请邮件。我侵入了邀请!方法和添加的self.skip\u确认!我昨天添加了一个答案,我不知道它在哪里!我希望它跳过确认邮件,而不是邀请邮件。我侵入了邀请!方法和添加的self.skip\u确认!但是,如果您想确认未经邀请注册的用户,该怎么办?如果您想确认未经邀请注册的用户,该怎么办?
:跳过确认如果不希望将任何确认逻辑应用于此用户<代码>:跳过确认通知
将禁用信件,但仍会强制用户在允许其登录之前确认电子邮件
:跳过确认如果不希望将任何确认逻辑应用于此用户<代码>:跳过确认通知将禁用信件,但仍会强制用户在允许其登录之前确认电子邮件