From cc9ab54fed3d1c3c7242e46a0d642739b9ffccca Mon Sep 17 00:00:00 2001 From: Ahmad Farhat Date: Wed, 22 Nov 2023 15:50:12 -0500 Subject: [PATCH] More fixes for email notification (#5566) --- app/controllers/api/v1/users_controller.rb | 2 +- app/controllers/api/v1/verify_account_controller.rb | 5 ++--- app/controllers/external_controller.rb | 5 ++++- config/locales/en.yml | 2 +- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/app/controllers/api/v1/users_controller.rb b/app/controllers/api/v1/users_controller.rb index 558dda4a9d..253371103f 100644 --- a/app/controllers/api/v1/users_controller.rb +++ b/app/controllers/api/v1/users_controller.rb @@ -77,7 +77,7 @@ def create activation_url: activate_account_url(token), base_url: request.base_url, provider: current_provider).activate_account_email.deliver_later - UserMailer.with(user:, admin_panel_url:, provider: current_provider).new_user_signup_email.deliver_later + UserMailer.with(user:, admin_panel_url:, base_url: request.base_url, provider: current_provider).new_user_signup_email.deliver_later end create_default_room(user) diff --git a/app/controllers/api/v1/verify_account_controller.rb b/app/controllers/api/v1/verify_account_controller.rb index 8e508fc059..876eb3014d 100644 --- a/app/controllers/api/v1/verify_account_controller.rb +++ b/app/controllers/api/v1/verify_account_controller.rb @@ -29,9 +29,8 @@ class VerifyAccountController < ApiController def create token = @user.generate_activation_token! - UserMailer.with(user: @user, - activation_url: activate_account_url(token), base_url: request.base_url, - provider: current_provider).activate_account_email.deliver_later + UserMailer.with(user: @user, activation_url: activate_account_url(token), + base_url: request.base_url, provider: current_provider).activate_account_email.deliver_later render_data status: :ok end diff --git a/app/controllers/external_controller.rb b/app/controllers/external_controller.rb index 0c6e2bbe4a..4bb6bdeb8b 100644 --- a/app/controllers/external_controller.rb +++ b/app/controllers/external_controller.rb @@ -55,7 +55,10 @@ def create_user create_default_room(user) # Send admins an email if smtp is enabled - UserMailer.with(user:, admin_panel_url:, provider: current_provider).new_user_signup_email.deliver_later if ENV['SMTP_SERVER'].present? + if ENV['SMTP_SERVER'].present? + UserMailer.with(user:, admin_panel_url:, base_url: request.base_url, + provider: current_provider).new_user_signup_email.deliver_later + end end if SettingGetter.new(setting_name: 'ResyncOnLogin', provider:).call diff --git a/config/locales/en.yml b/config/locales/en.yml index ba04fe59fc..a5437ca7f3 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -66,7 +66,7 @@ en: valid_invitation: The invitation is valid for 24 hours. sign_up: Sign Up new_user_signup: - new_user: New User Signup + new_user: New BigBlueButton User Signup new_user_description: A new user has signed up to use BigBlueButton. name: "Name: %{name}" email: "Email: %{email}"