<%= t('mailer.common.hi', name: @resource.name) %>,

<% account_user = @resource&.account_users&.first %> <% is_saml_account = account_user&.account&.saml_enabled? %> <% brand_name = global_config['BRAND_NAME'] || 'Chatwoot' %> <% if account_user&.inviter.present? && @resource.unconfirmed_email.blank? %> <% if is_saml_account %>

<%= t('mailer.devise.confirmation_instructions.invited_sso_html', inviter_name: account_user.inviter.name, account_name: account_user.account.name, brand_name: brand_name) %>

<%= t('mailer.devise.confirmation_instructions.sso_no_password_html') %>

<% else %>

<%= t('mailer.devise.confirmation_instructions.invited_html', inviter_name: account_user.inviter.name, account_name: account_user.account.name, brand_name: brand_name) %>

<% end %> <% end %> <% if @resource.confirmed? %>

<%= t('mailer.devise.confirmation_instructions.login_message_html', brand_name: brand_name) %>

<% else %> <% if account_user&.inviter.blank? %>

<%= t('mailer.devise.confirmation_instructions.welcome_html', brand_name: brand_name) %>

<% end %> <% unless is_saml_account %>

<%= t('mailer.devise.confirmation_instructions.activate_html') %>

<% end %> <% end %> <% if @resource.unconfirmed_email.present? %>

<%= link_to t('mailer.devise.confirmation_instructions.confirm_account'), frontend_url('auth/confirmation', confirmation_token: @token) %>

<% elsif @resource.confirmed? %> <% if is_saml_account %>

<%= t('mailer.devise.confirmation_instructions.sso_login_html') %>

<% else %>

<%= link_to t('mailer.devise.confirmation_instructions.login_account'), frontend_url('auth/sign_in') %>

<% end %> <% elsif account_user&.inviter.present? %> <% if is_saml_account %>

<%= t('mailer.devise.confirmation_instructions.sso_access_html') %>

<% else %>

<%= link_to t('mailer.devise.confirmation_instructions.confirm_account'), frontend_url('auth/password/edit', reset_password_token: @resource.send(:set_reset_password_token)) %>

<% end %> <% else %>

<%= link_to t('mailer.devise.confirmation_instructions.confirm_account'), frontend_url('auth/confirmation', confirmation_token: @token) %>

<% end %>