Hi <%= @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 %> <% if @resource.confirmed? %>You can login to your <%= global_config['BRAND_NAME'] || 'Chatwoot' %> account through the link below:
<% else %> <% if account_user&.inviter.blank? %>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.
<% end %>Please take a moment and click the link below and activate your account.
<% end %> <% if @resource.unconfirmed_email.present? %><%= link_to 'Confirm my account', frontend_url('auth/confirmation', confirmation_token: @token) %>
<% elsif @resource.confirmed? %><%= link_to 'Login to my account', frontend_url('auth/sign_in') %>
<% elsif account_user&.inviter.present? %><%= 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 %>