From f6422fed7aebab2d80ed6b2004a344e154d562fa Mon Sep 17 00:00:00 2001 From: Sai Pavan Marlakunta Date: Thu, 25 May 2023 18:08:49 +0000 Subject: [PATCH 1/6] Enabling SMTP feature to send emails via ActionMailer --- app/controllers/application_controller.rb | 9 ++ app/controllers/memberships_controller.rb | 2 + app/controllers/reviews_controller.rb | 16 ++- .../components/rules/RuleEditorHeader.vue | 3 +- app/mailers/user_mailer.rb | 108 ++++++++++++++++++ app/views/user_mailer/_shared_styles.html.erb | 44 +++++++ app/views/user_mailer/approve_review.html.erb | 21 ++++ app/views/user_mailer/request_review.html.erb | 21 ++++ .../request_review_changes.html.erb | 21 ++++ app/views/user_mailer/revoke_review.html.erb | 21 ++++ .../welcome_project_member.html.erb | 18 +++ config/initializers/smtp_settings.rb | 3 + 12 files changed, 284 insertions(+), 3 deletions(-) create mode 100644 app/mailers/user_mailer.rb create mode 100644 app/views/user_mailer/_shared_styles.html.erb create mode 100644 app/views/user_mailer/approve_review.html.erb create mode 100644 app/views/user_mailer/request_review.html.erb create mode 100644 app/views/user_mailer/request_review_changes.html.erb create mode 100644 app/views/user_mailer/revoke_review.html.erb create mode 100644 app/views/user_mailer/welcome_project_member.html.erb diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 5709b900..e497067f 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -104,6 +104,14 @@ def slack_notification_params(notification_type, object) } end + def send_smtp_notification(mailer, action, *args) + mailer.request_review(*args).deliver_now if action == 'request_review' + mailer.approve_review(*args).deliver_now if action == 'approve' + mailer.revoke_review(*args).deliver_now if action == 'revoke_review_request' + mailer.request_review_changes(*args).deliver_now if action == 'request_changes' + mailer.welcome_project_member(*args).deliver_now if action == 'welcome_user' + end + private def helpful_errors(exception) @@ -156,3 +164,4 @@ def setup_navigation @navigation += helpers.base_navigation if current_user end end + diff --git a/app/controllers/memberships_controller.rb b/app/controllers/memberships_controller.rb index e545bedb..ad9e1fce 100644 --- a/app/controllers/memberships_controller.rb +++ b/app/controllers/memberships_controller.rb @@ -28,6 +28,7 @@ def create membership = Membership.new(membership_create_params) if membership.save flash.notice = 'Successfully created membership.' + send_smtp_notification(UserMailer, 'welcome_user', current_user, membership) if Settings.smtp.enabled case membership.membership_type when 'Project' send_membership_notification(:create_project_membership, membership) @@ -104,3 +105,4 @@ def send_membership_notification(notification_type, membership) send_slack_notification(notification_type, membership) end end + diff --git a/app/controllers/reviews_controller.rb b/app/controllers/reviews_controller.rb index 4fa771b3..9f86bf44 100644 --- a/app/controllers/reviews_controller.rb +++ b/app/controllers/reviews_controller.rb @@ -10,8 +10,19 @@ class ReviewsController < ApplicationController before_action :authorize_author_project def create - review = Review.new(review_params.merge({ user: current_user, rule: @rule })) + review_params_without_component_id = review_params.except('component_id') + review = Review.new(review_params_without_component_id.merge({ user: current_user, rule: @rule })) if review.save + if Settings.smtp.enabled + send_smtp_notification( + UserMailer, + review_params[:action], + current_user, + review_params[:component_id], + review_params[:comment], + @rule + ) + end render json: { toast: 'Successfully added review.' } else render json: { @@ -81,6 +92,7 @@ def set_project end def review_params - params.require(:review).permit(:action, :comment) + params.require(:review).permit(:component_id, :action, :comment) end end + diff --git a/app/javascript/components/rules/RuleEditorHeader.vue b/app/javascript/components/rules/RuleEditorHeader.vue index 34c6734e..a8c0a3f7 100644 --- a/app/javascript/components/rules/RuleEditorHeader.vue +++ b/app/javascript/components/rules/RuleEditorHeader.vue @@ -163,7 +163,6 @@ required /> - + diff --git a/app/mailers/user_mailer.rb b/app/mailers/user_mailer.rb new file mode 100644 index 00000000..4c10ea88 --- /dev/null +++ b/app/mailers/user_mailer.rb @@ -0,0 +1,108 @@ +# frozen_string_literal: true + +# Sends Email Notifications to users if Vulcan is configured to use an SMTP server +class UserMailer < ApplicationMailer + def welcome_project_member(*args) + parse_mailer_welcome_user_args(*args) + begin + mail( + to: @user.email, + cc: @project_admins, + subject: "Welcome to Vulcan Project - #{Project.find(@project_id).name}", + from: Settings.smtp.settings.user_name + ) + rescue StandardError => e + Rails.logger.error("Error delivering welcome email to user #{@user.name}: #{e.message}") + end + end + + def request_review(*args) + parse_mailer_review_args(*args) + begin + mail( + to: @project_admins, + cc: @current_user.email, + subject: "Review Requested - #{@stig_id}", + from: Settings.smtp.settings.user_name + ) + rescue StandardError => e + Rails.logger.error("Error delivering request_review by user #{@current_user.name}: #{e.message}") + end + end + + def approve_review(*args) + parse_mailer_review_args(*args) + @latest_review_user = find_latest_request_review(@rule, @component_id) + begin + mail( + to: @latest_review_user.email, + cc: @project_admins, + subject: "Review Approved - #{@stig_id}", + from: Settings.smtp.settings.user_name + ) + rescue StandardError => e + Rails.logger.error("Error delivering approve_review by user #{@current_user.name}: #{e.message}") + end + end + + def revoke_review(*args) + parse_mailer_review_args(*args) + @latest_review_user = find_latest_request_review(@rule, @component_id) + begin + mail( + to: @latest_review_user.email, + cc: @project_admins, + subject: "Review Revoked - #{@stig_id}", + from: Settings.smtp.settings.user_name + ) + rescue StandardError => e + Rails.logger.error("Error delivering revoke_review_request by user #{@current_user.name}: #{e.message}") + end + end + + def request_review_changes(*args) + parse_mailer_review_args(*args) + @latest_review_user = find_latest_request_review(@rule, @component_id) + begin + mail( + to: @latest_review_user.email, + cc: @project_admins, + subject: "Requesting Changes on the Review - #{@stig_id}", + from: Settings.smtp.settings.user_name + ) + rescue StandardError => e + Rails.logger.error("Error delivering request_review_changes by user #{@current_user.name}: #{e.message}") + end + end + + private + + def get_project_admins(project_id) + Project.find(project_id).users.where(memberships: { role: 'admin' }).pluck(:email) + end + + def parse_mailer_review_args(*args) + @current_user, @component_id, @comment, @rule = args + @stig_id = "#{Component.find(@component_id).prefix}-#{@rule.rule_id}" + @project_id = Component.find(@component_id).project.id + @project_admins = get_project_admins(@project_id) + end + + def parse_mailer_welcome_user_args(*args) + @current_user, @membership = args + membership_id = @membership.membership_id + @project_id = membership_id + @project_admins = get_project_admins(membership_id) + @user = User.find(@membership.user_id) + @role_assigned = @membership.role.to_s + end + + def find_latest_request_review(rule, component_id) + latest_review = Review.where( + rule_id: Rule.find_by(rule_id: rule.rule_id.to_s, component_id: component_id).id, + action: 'request_review' + ).order(updated_at: :desc).first + latest_review.user + end +end + diff --git a/app/views/user_mailer/_shared_styles.html.erb b/app/views/user_mailer/_shared_styles.html.erb new file mode 100644 index 00000000..543aeff3 --- /dev/null +++ b/app/views/user_mailer/_shared_styles.html.erb @@ -0,0 +1,44 @@ + + + + + diff --git a/app/views/user_mailer/approve_review.html.erb b/app/views/user_mailer/approve_review.html.erb new file mode 100644 index 00000000..10bc244f --- /dev/null +++ b/app/views/user_mailer/approve_review.html.erb @@ -0,0 +1,21 @@ + + + <%= render 'user_mailer/shared_styles' %> + +

Hi <%=@latest_review_user.name %>,

+ <% if Settings.app_url.present? %> +

<%= @current_user.name %> approved review on <%= link_to @stig_id, "#{Settings.app_url}/components/#{@component_id}/#{@stig_id}" %> .

+ <% else %> +

<%= @current_user.name %> approved review on <%= @stig_id %>.

+ <% end %> +

The approved comments are:

+
+ <%= @comment %> +
+
+
+

Thank you,

+

Vulcan Support

+ + + diff --git a/app/views/user_mailer/request_review.html.erb b/app/views/user_mailer/request_review.html.erb new file mode 100644 index 00000000..5ea8bb5e --- /dev/null +++ b/app/views/user_mailer/request_review.html.erb @@ -0,0 +1,21 @@ + + + <%= render 'user_mailer/shared_styles' %> + +

Hello ProjectAdmins,

+ <% if Settings.app_url.present? %> +

<%= @current_user.name %> requested review on <%= link_to @stig_id, "#{Settings.app_url}/components/#{@component_id}/#{@stig_id}" %> .

+ <% else %> +

<%= @current_user.name %> requested review on <%= @stig_id %>.

+ <% end %> +

The review comment is:

+
+ <%= @comment %> +
+
+
+

Thank you,

+

Vulcan Support

+ + + diff --git a/app/views/user_mailer/request_review_changes.html.erb b/app/views/user_mailer/request_review_changes.html.erb new file mode 100644 index 00000000..8a437fe2 --- /dev/null +++ b/app/views/user_mailer/request_review_changes.html.erb @@ -0,0 +1,21 @@ + + + <%= render 'user_mailer/shared_styles' %> + +

Hi <%=@latest_review_user.name %>,

+ <% if Settings.app_url.present? %> +

<%= @current_user.name %> requested changes on the review <%= link_to @stig_id, "#{Settings.app_url}/components/#{@component_id}/#{@stig_id}" %> .

+ <% else %> +

<%= @current_user.name %> requested changes on the review <%= @stig_id %>.

+ <% end %> +

The comments are:

+
+ <%= @comment %> +
+
+
+

Thank you,

+

Vulcan Support

+ + + diff --git a/app/views/user_mailer/revoke_review.html.erb b/app/views/user_mailer/revoke_review.html.erb new file mode 100644 index 00000000..87e9bfc9 --- /dev/null +++ b/app/views/user_mailer/revoke_review.html.erb @@ -0,0 +1,21 @@ + + + <%= render 'user_mailer/shared_styles' %> + +

Hi <%=@latest_review_user.name %>,

+ <% if Settings.app_url.present? %> +

<%= @current_user.name %> revoked review on <%= link_to @stig_id, "#{Settings.app_url}/components/#{@component_id}/#{@stig_id}" %> .

+ <% else %> +

<%= @current_user.name %> revoked review on <%= @stig_id %>.

+ <% end %> +

The revoked comments are:

+
+ <%= @comment %> +
+
+
+

Thank you,

+

Vulcan Support

+ + + diff --git a/app/views/user_mailer/welcome_project_member.html.erb b/app/views/user_mailer/welcome_project_member.html.erb new file mode 100644 index 00000000..9b22594b --- /dev/null +++ b/app/views/user_mailer/welcome_project_member.html.erb @@ -0,0 +1,18 @@ + + + <%= render 'user_mailer/shared_styles' %> + +

Vulcan Project Access

+

Hi <%= @user.name %>,

+

You have been added to the <%= @role_assigned %> role in the <%= Project.find(@project_id).name %> project.

+ <% if Settings.app_url.present? %> +

You can access the project at <%= link_to Project.find(@project_id).name, "#{Settings.app_url}/projects/#{@project_id}" %> .

+ <% else %> +

You can access the project "<%= Project.find(@project_id).name %>".

+ <% end %> +
+
+

Thank you,

+

Vulcan Support

+ + diff --git a/config/initializers/smtp_settings.rb b/config/initializers/smtp_settings.rb index 6e72e88d..c0342d9c 100644 --- a/config/initializers/smtp_settings.rb +++ b/config/initializers/smtp_settings.rb @@ -6,7 +6,10 @@ if Rails.env.production? && Settings.smtp.enabled Rails.application.config.action_mailer.delivery_method = :smtp + Rails.application.config.action_mailer.perform_deliveries = true + Rails.application.config.action_mailer.raise_delivery_errors = true ActionMailer::Base.delivery_method = :smtp ActionMailer::Base.smtp_settings = Settings.smtp.settings.transform_keys(&:to_sym) end + From 006977cb52fb83ac73998ca349e17be94cda5658 Mon Sep 17 00:00:00 2001 From: Sai Pavan Marlakunta Date: Thu, 25 May 2023 18:44:00 +0000 Subject: [PATCH 2/6] fixing rubocop offenses - TrailingEmptyLines --- app/controllers/application_controller.rb | 1 - app/controllers/memberships_controller.rb | 1 - app/controllers/reviews_controller.rb | 1 - app/mailers/user_mailer.rb | 1 - config/initializers/smtp_settings.rb | 1 - 5 files changed, 5 deletions(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index e497067f..7fbef2d3 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -164,4 +164,3 @@ def setup_navigation @navigation += helpers.base_navigation if current_user end end - diff --git a/app/controllers/memberships_controller.rb b/app/controllers/memberships_controller.rb index ad9e1fce..3a6d4c6d 100644 --- a/app/controllers/memberships_controller.rb +++ b/app/controllers/memberships_controller.rb @@ -105,4 +105,3 @@ def send_membership_notification(notification_type, membership) send_slack_notification(notification_type, membership) end end - diff --git a/app/controllers/reviews_controller.rb b/app/controllers/reviews_controller.rb index 9f86bf44..946e5ed5 100644 --- a/app/controllers/reviews_controller.rb +++ b/app/controllers/reviews_controller.rb @@ -95,4 +95,3 @@ def review_params params.require(:review).permit(:component_id, :action, :comment) end end - diff --git a/app/mailers/user_mailer.rb b/app/mailers/user_mailer.rb index 4c10ea88..220e9616 100644 --- a/app/mailers/user_mailer.rb +++ b/app/mailers/user_mailer.rb @@ -105,4 +105,3 @@ def find_latest_request_review(rule, component_id) latest_review.user end end - diff --git a/config/initializers/smtp_settings.rb b/config/initializers/smtp_settings.rb index c0342d9c..e6eb594b 100644 --- a/config/initializers/smtp_settings.rb +++ b/config/initializers/smtp_settings.rb @@ -12,4 +12,3 @@ ActionMailer::Base.delivery_method = :smtp ActionMailer::Base.smtp_settings = Settings.smtp.settings.transform_keys(&:to_sym) end - From fb99a633265d60bd3798526d7b2f0a74805c4987 Mon Sep 17 00:00:00 2001 From: Sai Pavan Marlakunta Date: Thu, 25 May 2023 19:18:21 +0000 Subject: [PATCH 3/6] Linting Issues on .Vue files --- app/javascript/components/rules/RuleEditorHeader.vue | 1 - 1 file changed, 1 deletion(-) diff --git a/app/javascript/components/rules/RuleEditorHeader.vue b/app/javascript/components/rules/RuleEditorHeader.vue index a8c0a3f7..390e62b3 100644 --- a/app/javascript/components/rules/RuleEditorHeader.vue +++ b/app/javascript/components/rules/RuleEditorHeader.vue @@ -509,4 +509,3 @@ export default { color: inherit; } - From 97857dd3e0f00801cfd7f93001b7fdafbbf7036b Mon Sep 17 00:00:00 2001 From: Sai Pavan Marlakunta Date: Fri, 26 May 2023 16:59:30 +0000 Subject: [PATCH 4/6] SMTP controller logic modified to welcome project,component users; Created Instance Variables to Avoid DB Model access from views --- app/controllers/application_controller.rb | 3 +- app/controllers/memberships_controller.rb | 3 +- app/mailers/user_mailer.rb | 28 +++++++++++++++++-- .../welcome_component_member.html.erb | 19 +++++++++++++ .../welcome_project_member.html.erb | 7 +++-- 5 files changed, 52 insertions(+), 8 deletions(-) create mode 100644 app/views/user_mailer/welcome_component_member.html.erb diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 7fbef2d3..5789c0bd 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -109,7 +109,8 @@ def send_smtp_notification(mailer, action, *args) mailer.approve_review(*args).deliver_now if action == 'approve' mailer.revoke_review(*args).deliver_now if action == 'revoke_review_request' mailer.request_review_changes(*args).deliver_now if action == 'request_changes' - mailer.welcome_project_member(*args).deliver_now if action == 'welcome_user' + mailer.welcome_project_member(*args).deliver_now if action == 'project_user' + mailer.welcome_component_member(*args).deliver_now if action == 'component_user' end private diff --git a/app/controllers/memberships_controller.rb b/app/controllers/memberships_controller.rb index 3a6d4c6d..070b2f44 100644 --- a/app/controllers/memberships_controller.rb +++ b/app/controllers/memberships_controller.rb @@ -28,11 +28,12 @@ def create membership = Membership.new(membership_create_params) if membership.save flash.notice = 'Successfully created membership.' - send_smtp_notification(UserMailer, 'welcome_user', current_user, membership) if Settings.smtp.enabled case membership.membership_type when 'Project' + send_smtp_notification(UserMailer, 'project_user', current_user, membership) if Settings.smtp.enabled send_membership_notification(:create_project_membership, membership) when 'Component' + send_smtp_notification(UserMailer, 'component_user', current_user, membership) if Settings.smtp.enabled send_membership_notification(:create_component_membership, membership) end redirect_to membership.membership diff --git a/app/mailers/user_mailer.rb b/app/mailers/user_mailer.rb index 220e9616..adfd3985 100644 --- a/app/mailers/user_mailer.rb +++ b/app/mailers/user_mailer.rb @@ -8,7 +8,21 @@ def welcome_project_member(*args) mail( to: @user.email, cc: @project_admins, - subject: "Welcome to Vulcan Project - #{Project.find(@project_id).name}", + subject: "Vulcan Project Access - #{@project_name}", + from: Settings.smtp.settings.user_name + ) + rescue StandardError => e + Rails.logger.error("Error delivering welcome email to user #{@user.name}: #{e.message}") + end + end + + def welcome_component_member(*args) + parse_mailer_welcome_user_args(*args) + begin + mail( + to: @user.email, + cc: @project_admins, + subject: "Vulcan Component Access - #{@component_name}", from: Settings.smtp.settings.user_name ) rescue StandardError => e @@ -91,8 +105,16 @@ def parse_mailer_review_args(*args) def parse_mailer_welcome_user_args(*args) @current_user, @membership = args membership_id = @membership.membership_id - @project_id = membership_id - @project_admins = get_project_admins(membership_id) + case @membership.membership_type + when 'Project' + @project_id = membership_id + @project_name = Project.find(@project_id).name + when 'Component' + @component_id = membership_id + @project_id = Component.find(@component_id).project_id + @component_name = Component.find(@component_id).name + end + @project_admins = get_project_admins(@project_id) @user = User.find(@membership.user_id) @role_assigned = @membership.role.to_s end diff --git a/app/views/user_mailer/welcome_component_member.html.erb b/app/views/user_mailer/welcome_component_member.html.erb new file mode 100644 index 00000000..a651779e --- /dev/null +++ b/app/views/user_mailer/welcome_component_member.html.erb @@ -0,0 +1,19 @@ + + + <%= render 'user_mailer/shared_styles' %> + +

Vulcan Component Access

+

Hi <%= @user.name %>,

+

You have been added to the <%= @role_assigned %> role in the <%= @component_name %> project.

+ <% if Settings.app_url.present? %> +

You can access the component at <%= link_to @component_name, "#{Settings.app_url}/components/#{@component_id}" %> .

+ <% else %> +

You can access the component "<%= @component_name %>".

+ <% end %> +
+
+

Thank you,

+

Vulcan Support

+ + + diff --git a/app/views/user_mailer/welcome_project_member.html.erb b/app/views/user_mailer/welcome_project_member.html.erb index 9b22594b..0f3d3602 100644 --- a/app/views/user_mailer/welcome_project_member.html.erb +++ b/app/views/user_mailer/welcome_project_member.html.erb @@ -4,11 +4,11 @@

Vulcan Project Access

Hi <%= @user.name %>,

-

You have been added to the <%= @role_assigned %> role in the <%= Project.find(@project_id).name %> project.

+

You have been added to the <%= @role_assigned %> role in the <%= @project_name %> project.

<% if Settings.app_url.present? %> -

You can access the project at <%= link_to Project.find(@project_id).name, "#{Settings.app_url}/projects/#{@project_id}" %> .

+

You can access the project at <%= link_to @project_name, "#{Settings.app_url}/projects/#{@project_id}" %> .

<% else %> -

You can access the project "<%= Project.find(@project_id).name %>".

+

You can access the project "<%= @project_name %>".

<% end %>

@@ -16,3 +16,4 @@

Vulcan Support

+ From 0c709ffb18afac6d1c0f0f012aadbe699bb85824 Mon Sep 17 00:00:00 2001 From: Sai Pavan Marlakunta Date: Fri, 26 May 2023 17:10:23 +0000 Subject: [PATCH 5/6] Removed project reference as this is related to a component --- app/views/user_mailer/welcome_component_member.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/user_mailer/welcome_component_member.html.erb b/app/views/user_mailer/welcome_component_member.html.erb index a651779e..945b09f1 100644 --- a/app/views/user_mailer/welcome_component_member.html.erb +++ b/app/views/user_mailer/welcome_component_member.html.erb @@ -4,7 +4,7 @@

Vulcan Component Access

Hi <%= @user.name %>,

-

You have been added to the <%= @role_assigned %> role in the <%= @component_name %> project.

+

You have been added to the <%= @role_assigned %> role in the <%= @component_name %> component.

<% if Settings.app_url.present? %>

You can access the component at <%= link_to @component_name, "#{Settings.app_url}/components/#{@component_id}" %> .

<% else %> From ff3c544466df1cab79d0eb931037024ea0d66eee Mon Sep 17 00:00:00 2001 From: Sai Pavan Marlakunta Date: Fri, 26 May 2023 18:12:22 +0000 Subject: [PATCH 6/6] reduced db round trips --- app/mailers/user_mailer.rb | 15 +++++++-------- .../user_mailer/welcome_component_member.html.erb | 7 +++---- .../user_mailer/welcome_project_member.html.erb | 7 +++---- 3 files changed, 13 insertions(+), 16 deletions(-) diff --git a/app/mailers/user_mailer.rb b/app/mailers/user_mailer.rb index adfd3985..e2abbfdd 100644 --- a/app/mailers/user_mailer.rb +++ b/app/mailers/user_mailer.rb @@ -8,7 +8,7 @@ def welcome_project_member(*args) mail( to: @user.email, cc: @project_admins, - subject: "Vulcan Project Access - #{@project_name}", + subject: "Vulcan Project Access - #{@project.name}", from: Settings.smtp.settings.user_name ) rescue StandardError => e @@ -22,7 +22,7 @@ def welcome_component_member(*args) mail( to: @user.email, cc: @project_admins, - subject: "Vulcan Component Access - #{@component_name}", + subject: "Vulcan Component Access - #{@component.name}", from: Settings.smtp.settings.user_name ) rescue StandardError => e @@ -104,15 +104,14 @@ def parse_mailer_review_args(*args) def parse_mailer_welcome_user_args(*args) @current_user, @membership = args - membership_id = @membership.membership_id case @membership.membership_type when 'Project' - @project_id = membership_id - @project_name = Project.find(@project_id).name + @project_id = @membership.membership_id + @project = Project.find(@project_id) when 'Component' - @component_id = membership_id - @project_id = Component.find(@component_id).project_id - @component_name = Component.find(@component_id).name + @component_id = @membership.membership_id + @component = Component.find(@component_id) + @project_id = @component.project_id end @project_admins = get_project_admins(@project_id) @user = User.find(@membership.user_id) diff --git a/app/views/user_mailer/welcome_component_member.html.erb b/app/views/user_mailer/welcome_component_member.html.erb index 945b09f1..abf9f01a 100644 --- a/app/views/user_mailer/welcome_component_member.html.erb +++ b/app/views/user_mailer/welcome_component_member.html.erb @@ -4,11 +4,11 @@

Vulcan Component Access

Hi <%= @user.name %>,

-

You have been added to the <%= @role_assigned %> role in the <%= @component_name %> component.

+

You have been added to the <%= @role_assigned %> role in the <%= @component.name %> component.

<% if Settings.app_url.present? %> -

You can access the component at <%= link_to @component_name, "#{Settings.app_url}/components/#{@component_id}" %> .

+

You can access the component at <%= link_to @component.name, "#{Settings.app_url}/components/#{@component_id}" %> .

<% else %> -

You can access the component "<%= @component_name %>".

+

You can access the component "<%= @component.name %>".

<% end %>

@@ -16,4 +16,3 @@

Vulcan Support

- diff --git a/app/views/user_mailer/welcome_project_member.html.erb b/app/views/user_mailer/welcome_project_member.html.erb index 0f3d3602..09d11ef5 100644 --- a/app/views/user_mailer/welcome_project_member.html.erb +++ b/app/views/user_mailer/welcome_project_member.html.erb @@ -4,11 +4,11 @@

Vulcan Project Access

Hi <%= @user.name %>,

-

You have been added to the <%= @role_assigned %> role in the <%= @project_name %> project.

+

You have been added to the <%= @role_assigned %> role in the <%= @project.name %> project.

<% if Settings.app_url.present? %> -

You can access the project at <%= link_to @project_name, "#{Settings.app_url}/projects/#{@project_id}" %> .

+

You can access the project at <%= link_to @project.name, "#{Settings.app_url}/projects/#{@project_id}" %> .

<% else %> -

You can access the project "<%= @project_name %>".

+

You can access the project "<%= @project.name %>".

<% end %>

@@ -16,4 +16,3 @@

Vulcan Support

-