fix: Fixes wrong copy being sent to users via email invite [cw-1290] (#7159)

* fix: Fixes invite email copy

* fix: Fixes wrong copy being sent to users via email invite
This commit is contained in:
Nithin David Thomas
2023-05-23 09:37:40 +05:30
committed by GitHub
parent 4f0fcfcbcd
commit 2764338453
2 changed files with 5 additions and 1 deletions

View File

@@ -9,9 +9,11 @@
<% if @resource.confirmed? %>
<p>You can login to your <%= global_config['BRAND_NAME'] || 'Chatwoot' %> account through the link below:</p>
<% else %>
<% if account_user&.inviter.blank? %>
<p>
Welcome to <%= global_config['BRAND_NAME'] || 'Chatwoot' %>! We have a suite of powerful tools ready for you to explore. Before that we quickly need to verify your email address to know it's really you.
</p>
<% end %>
<p>Please take a moment and click the link below and activate your account.</p>
<% end %>
@@ -24,4 +26,4 @@
<p><%= link_to 'Confirm my account', frontend_url('auth/password/edit', reset_password_token: @resource.send(:set_reset_password_token)) %></p>
<% else %>
<p><%= link_to 'Confirm my account', frontend_url('auth/confirmation', confirmation_token: @token) %></p>
<% end %>
<% end %>

View File

@@ -27,6 +27,7 @@ RSpec.describe 'Confirmation Instructions' do
it 'does not refer to the inviter and their account' do
expect(mail.body).to_not match('has invited you to try out Chatwoot!')
expect(mail.body).to match('We have a suite of powerful tools ready for you to explore.')
end
it 'sends a confirmation link' do
@@ -41,6 +42,7 @@ RSpec.describe 'Confirmation Instructions' do
expect(mail.body).to match(
"#{CGI.escapeHTML(inviter_val.name)}, with #{CGI.escapeHTML(account.name)}, has invited you to try out Chatwoot."
)
expect(mail.body).not_to match('We have a suite of powerful tools ready for you to explore.')
end
it 'sends a password reset link' do