Devise - Different email when manually registered

只愿长相守 提交于 2019-12-04 22:01:29

I think you can skip sending the original confirmation mail in your admin action. Simple create your own mailer action and send your desired mail.

Maybe it is also possible to create a normal confirmation mail, but modify the mail output.

bundle exec rails generate devise:views

And after that modify the text in "app/views/devise/mailer/confirmation_instructions.html.erb

<% if @sent_by_admin == true %>
  ...admin mailer text...
<% else %>
  ...normal mailer text...
<% end %>

@sent_by_admin could be a helper variable, which is passed to the devise confirmation mailer.

I expect you would need to follow the instructions on the [devise page to generate the controllers and then modify your create action to generate the additional email.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!