sul-dlss/exhibits

View on GitHub
app/views/devise/mailer/invitation_instructions.html.erb

Summary

Maintainability
Test Coverage
<%
  key = if @resource.roles.first.resource.is_a?(Spotlight::Site)
    'exhibits_admin_invitation_mailer'
  else
    'invitation_mailer'
  end
%>
<p><%= t("spotlight.#{key}.invitation_instructions.hello", email: @resource.email) %></p>

<p><%= t("spotlight.#{key}.invitation_instructions.someone_invited_you", role: @resource.roles.first.role, exhibit_name: @resource.roles.first.resource.title, url: spotlight.exhibit_home_page_url(@resource.roles.first.resource)) %></p>

<% # We pass the user to the new_user_session_url so that they are kicked through our authentication service. Devise's default behavior is to send a user to a password confirmation page, which we do not want. %>
<p><%= link_to t("spotlight.#{key}.invitation_instructions.accept"), new_user_session_url(invitation_token: @token, referrer: spotlight.exhibit_path(@resource.roles.first.resource)) %></p>

<p><%= t("spotlight.#{key}.invitation_instructions.ignore_html", exhibit_name: @resource.roles.first.resource.title) %></p>

<p><%= t("spotlight.#{key}.invitation_instructions.spotlight_at_sul_html", :href => link_to(t("spotlight.#{key}.invitation_instructions.spotlight_at_sul_href"), t("spotlight.#{key}.invitation_instructions.about_spotlight_href"))) %></p>


<p><%= t("spotlight.#{key}.invitation_instructions.all_exhibits_html", :href => link_to(t("spotlight.#{key}.invitation_instructions.all_exhibits_href"), t("spotlight.#{key}.invitation_instructions.all_exhibits_href"))) %></p>

<p><%= t("spotlight.#{key}.invitation_instructions.get_help_html",  :mailto => mail_to(t("spotlight.#{key}.invitation_instructions.mail_to_href"))) %></p>

<p><%= t("spotlight.#{key}.invitation_instructions.closing_html", :mailto => mail_to(t("spotlight.#{key}.invitation_instructions.mail_to_href"))) %></p>