How to send a custom invitation using devise_invitable

I am new to ruby ​​and use devise_invitable gem for invitations. Each instruction is sent correctly. Now I want to add a custom object that will have the name of the invitee and the name of the board and custom content that will have the same things as the subject. How can I do this in the following action method without using additional custom code, etc.

def AddMember board = current_user.boards.find(params[:id]) # simply invite user ! invitee=User.invite!({:email => (params[:email])}, current_user) board.members << User.find_by_email(params[:email]) msg = "invitation sent" render json: msg,status: :ok return end msg = "some error occured - member adding failed" render json: msg,status: 500 end 
+1
source share
1 answer

Follow the instructions here .

This will only be the case of editing a presentation template for a presentation.

First add these lines to the environment.rb file in your Rails application.

 config.to_prepare do Devise::Mailer.layout "email" # email.haml or email.erb end 

Then edit the email.erb or email.haml file to create your own layout.

-1
source

Source: https://habr.com/ru/post/901085/


All Articles