diff --git a/app/controllers/users/confirmations_controller.rb b/app/controllers/users/confirmations_controller.rb deleted file mode 100644 index 1126e23aa..000000000 --- a/app/controllers/users/confirmations_controller.rb +++ /dev/null @@ -1,28 +0,0 @@ -class Users::ConfirmationsController < Devise::ConfirmationsController - # GET /resource/confirmation/new - # def new - # super - # end - - # POST /resource/confirmation - # def create - # super - # end - - # GET /resource/confirmation?confirmation_token=abcdef - # def show - # super - # end - - # protected - - # The path used after resending confirmation instructions. - # def after_resending_confirmation_instructions_path_for(resource_name) - # super(resource_name) - # end - - # The path used after confirmation. - # def after_confirmation_path_for(resource_name, resource) - # super(resource_name, resource) - # end -end diff --git a/app/controllers/users/omniauth_callbacks_controller.rb b/app/controllers/users/omniauth_callbacks_controller.rb deleted file mode 100644 index 1907e5b1b..000000000 --- a/app/controllers/users/omniauth_callbacks_controller.rb +++ /dev/null @@ -1,28 +0,0 @@ -class Users::OmniauthCallbacksController < Devise::OmniauthCallbacksController - # You should configure your model like this: - # devise :omniauthable, omniauth_providers: [:twitter] - - # You should also create an action method in this controller like this: - # def twitter - # end - - # More info at: - # https://github.com/plataformatec/devise#omniauth - - # GET|POST /resource/auth/twitter - # def passthru - # super - # end - - # GET|POST /users/auth/twitter/callback - # def failure - # super - # end - - # protected - - # The path used when OmniAuth fails - # def after_omniauth_failure_path_for(scope) - # super(scope) - # end -end diff --git a/app/controllers/users/passwords_controller.rb b/app/controllers/users/passwords_controller.rb deleted file mode 100644 index 53cc34e39..000000000 --- a/app/controllers/users/passwords_controller.rb +++ /dev/null @@ -1,32 +0,0 @@ -class Users::PasswordsController < Devise::PasswordsController - # GET /resource/password/new - # def new - # super - # end - - # POST /resource/password - # def create - # super - # end - - # GET /resource/password/edit?reset_password_token=abcdef - # def edit - # super - # end - - # PUT /resource/password - # def update - # super - # end - - # protected - - # def after_resetting_password_path_for(resource) - # super(resource) - # end - - # The path used after sending reset password instructions - # def after_sending_reset_password_instructions_path_for(resource_name) - # super(resource_name) - # end -end diff --git a/app/controllers/users/registrations_controller.rb b/app/controllers/users/registrations_controller.rb deleted file mode 100644 index 43e3d72ad..000000000 --- a/app/controllers/users/registrations_controller.rb +++ /dev/null @@ -1,66 +0,0 @@ -class Users::RegistrationsController < Devise::RegistrationsController -# before_action :configure_sign_up_params, only: [:create] -# before_action :configure_account_update_params, only: [:update] -before_filter :configure_permitted_parameters - - # GET /resource/sign_up - # def new - # super - # end - - # POST /resource - def create - super - end - - # GET /resource/edit - # def edit - # super - # end - - # PUT /resource - # def update - # super - # end - - # DELETE /resource - # def destroy - # super - # end - - # GET /resource/cancel - # Forces the session data which is usually expired after sign - # in to be expired now. This is useful if the user wants to - # cancel oauth signing in/up in the middle of the process, - # removing all OAuth session data. - # def cancel - # super - # end - - protected - - def configure_permitted_parameters - devise_parameter_sanitizer.permit(:sign_up) { |u| u.permit(:email, :password, :password_confirmation, account_attributes: [:name]) } - end - - # If you have extra params to permit, append them to the sanitizer. - # def configure_sign_up_params - # devise_parameter_sanitizer.permit(:sign_up, keys: [:attribute]) - # end - - # If you have extra params to permit, append them to the sanitizer. - # def configure_account_update_params - # devise_parameter_sanitizer.permit(:account_update, keys: [:attribute]) - # end - - # The path used after sign up. - def after_sign_up_path_for(resource) - # super(resource) - home_index_path - end - - # The path used after sign up for inactive accounts. - # def after_inactive_sign_up_path_for(resource) - # super(resource) - # end -end diff --git a/app/controllers/users/sessions_controller.rb b/app/controllers/users/sessions_controller.rb deleted file mode 100644 index 753ab7afa..000000000 --- a/app/controllers/users/sessions_controller.rb +++ /dev/null @@ -1,25 +0,0 @@ -class Users::SessionsController < Devise::SessionsController -# before_action :configure_sign_in_params, only: [:create] - - # GET /resource/sign_in - # def new - # super - # end - - # POST /resource/sign_in - # def create - # super - # end - - # DELETE /resource/sign_out - # def destroy - # super - # end - - # protected - - # If you have extra params to permit, append them to the sanitizer. - # def configure_sign_in_params - # devise_parameter_sanitizer.permit(:sign_in, keys: [:attribute]) - # end -end diff --git a/app/controllers/users/unlocks_controller.rb b/app/controllers/users/unlocks_controller.rb deleted file mode 100644 index 8b9ef8612..000000000 --- a/app/controllers/users/unlocks_controller.rb +++ /dev/null @@ -1,28 +0,0 @@ -class Users::UnlocksController < Devise::UnlocksController - # GET /resource/unlock/new - # def new - # super - # end - - # POST /resource/unlock - # def create - # super - # end - - # GET /resource/unlock?unlock_token=abcdef - # def show - # super - # end - - # protected - - # The path used after sending unlock password instructions - # def after_sending_unlock_instructions_path_for(resource) - # super(resource) - # end - - # The path used after unlocking the resource - # def after_unlock_path_for(resource) - # super(resource) - # end -end diff --git a/app/views/devise/mailer/confirmation_instructions.html.erb b/app/views/devise/mailer/confirmation_instructions.html.erb new file mode 100644 index 000000000..dc55f64f6 --- /dev/null +++ b/app/views/devise/mailer/confirmation_instructions.html.erb @@ -0,0 +1,5 @@ +

Welcome <%= @email %>!

+ +

You can confirm your account email through the link below:

+ +

<%= link_to 'Confirm my account', confirmation_url(@resource, confirmation_token: @token) %>

diff --git a/app/views/devise/mailer/password_change.html.erb b/app/views/devise/mailer/password_change.html.erb new file mode 100644 index 000000000..b41daf476 --- /dev/null +++ b/app/views/devise/mailer/password_change.html.erb @@ -0,0 +1,3 @@ +

Hello <%= @resource.email %>!

+ +

We're contacting you to notify you that your password has been changed.

diff --git a/app/views/devise/mailer/reset_password_instructions.html.erb b/app/views/devise/mailer/reset_password_instructions.html.erb new file mode 100644 index 000000000..f667dc12f --- /dev/null +++ b/app/views/devise/mailer/reset_password_instructions.html.erb @@ -0,0 +1,8 @@ +

Hello <%= @resource.email %>!

+ +

Someone has requested a link to change your password. You can do this through the link below.

+ +

<%= link_to 'Change my password', edit_password_url(@resource, reset_password_token: @token) %>

+ +

If you didn't request this, please ignore this email.

+

Your password won't change until you access the link above and create a new one.

diff --git a/app/views/devise/mailer/unlock_instructions.html.erb b/app/views/devise/mailer/unlock_instructions.html.erb new file mode 100644 index 000000000..41e148bf2 --- /dev/null +++ b/app/views/devise/mailer/unlock_instructions.html.erb @@ -0,0 +1,7 @@ +

Hello <%= @resource.email %>!

+ +

Your account has been locked due to an excessive number of unsuccessful sign in attempts.

+ +

Click the link below to unlock your account:

+ +

<%= link_to 'Unlock my account', unlock_url(@resource, unlock_token: @token) %>

diff --git a/app/views/layouts/mailer.html.erb b/app/views/layouts/mailer.html.erb index cbd34d2e9..208ef929c 100644 --- a/app/views/layouts/mailer.html.erb +++ b/app/views/layouts/mailer.html.erb @@ -1,13 +1,112 @@ - - - - - - + + + + + + + + + + + + + + + + + + + +
+
+ + + + +
+ + + <%= yield %> + + + + +
+ — Team Chatwoot
+ https://www.chatwoot.com +
+
+ +
+
+ - - <%= yield %> - diff --git a/app/views/layouts/mailer.text.erb b/app/views/layouts/mailer.text.erb deleted file mode 100644 index 37f0bddbd..000000000 --- a/app/views/layouts/mailer.text.erb +++ /dev/null @@ -1 +0,0 @@ -<%= yield %> diff --git a/config/initializers/devise.rb b/config/initializers/devise.rb index e17b6cf20..e6d00aea2 100644 --- a/config/initializers/devise.rb +++ b/config/initializers/devise.rb @@ -18,7 +18,7 @@ Devise.setup do |config| # config.mailer = 'Devise::Mailer' # Configure the parent class responsible to send e-mails. - # config.parent_mailer = 'ActionMailer::Base' + config.parent_mailer = 'ApplicationMailer' # ==> ORM configuration # Load and configure the ORM. Supports :active_record (default) and