<% define_content :link do %>
  <%= course_assignment_submission_url(asset.assignment.context, asset.assignment, asset.user_id) %>
<% end %>

<% define_content :subject do %>
  <%= t :subject, "Grade Changed: %{assignment}, %{context}", :assignment => asset.assignment.title, :context => asset.assignment.context.name %>
<% end %>

<% define_content :footer_link do %>
  <a href="<%= content(:link) %>">
    <%= t :link_message, "You can review the assignment here" %>
  </a>
<% end %>

<% if send_student_names(asset, user) %>
  <p><%= t "The grade on assignment %{assignment_title} has been changed for %{name}.", :assignment_title => asset.assignment.title, name: asset.user.name %></p>
<% else %>
  <p><%= t :body, "The grade on your assignment %{assignment_title} has been changed.", :assignment_title => asset.assignment.title %></p>
<% end %>

<p><%= t :regraded_date, "re-graded: %{date}", :date => (datetime_string(force_zone(asset.graded_at)) rescue t(:no_date_set, "No Date Set")) %></p>

<% if user.try(:send_scores_in_emails?, asset.assignment.context) %>
  <% if asset.excused? %>
    <p><%= t :excused, "This assignment has been excused." %></p>
  <% elsif asset.score %>
    <p><%= t :score, "score:  %{score} out of %{total}", :score => asset.score, :total => (asset.assignment.points_possible || t(:not_applicable, "N/A")) %></p>
  <% end %>
<% end %>

<p><%= t(:score_pending, "score pending review by the teacher") if asset.pending_review? %></p>
