Welcome, <%= @resource.name %>!

<% account_user = @resource&.account_users&.first %> <% if account_user&.inviter.present? && @resource.unconfirmed_email.blank? %>

<%= account_user.inviter.name %>, with <%= account_user.account.name %>, has invited you to try out <%= global_config['BRAND_NAME'] || 'Chatwoot' %>!

<% end %>

You can confirm your account email through the link below:

<% if account_user&.inviter.present? && @resource.unconfirmed_email.blank? %>

<%= link_to 'Confirm my account', frontend_url('auth/password/edit', reset_password_token: @resource.send(:set_reset_password_token)) %>

<% else %>

<%= link_to 'Confirm my account', frontend_url('auth/confirmation', confirmation_token: @token) %>

<% end %>