<% define_content :link do %>
  <%= course_url(asset.course, invitation: asset.uuid) %>
<% end %>

<% define_content :subject do %>
  <%= t :subject, "Course Invitation" %>
<% end %>

<% define_content :footer_link do %>
  <a href="<%= content(:link) %>">
    <%= t(:link, "Click here to view the course page") %>
  </a>
<% end %>

<% email = asset.user.email; login = (asset.user.pseudonym.unique_id rescue "none") %>

<p>
  <%= t "You've been invited to participate in the course, %{course}. Course role: %{role_type}",
      :course => asset.course.name, :role_type => asset.readable_role_name %>
</p>

<table border="0" style="font-size: 14px; color: #444444;
    font-family: 'Open Sans', 'Lucida Grande', 'Segoe UI', Arial, Verdana, 'Lucida Sans Unicode', Tahoma, 'Sans Serif';
    border-collapse: collapse;">
    <tr>
        <td style="padding-right: 10px;"><%= t(:name, 'Name') %>:</td>
        <td style="font-weight: bold;"><%= asset.user.name %></td>
    </tr>
    <tr>
        <td style="padding-right: 10px"><%= t(:email, 'Email') %>:</td>
        <td style="font-weight: bold;"><%= email %></td>
    </tr>
    <% if email != login %>
      <tr>
          <td style="padding-right: 10px;"><%= t(:username, 'Username') %>:</td>
          <td style="font-weight: bold;"><%= asset.user.pseudonym.unique_id rescue t(:none, "none") %></td>
      </tr>
    <% end %>
</table>

<br><br>

<table width="100%" border="0" style="text-align:center;">
  <tr>
    <td>
      <a href="<%= content(:link) %>" style="color: #FFFFFF; background-color: #008EE2; padding: 8px 40px; border-radius: 3px; text-decoration: none; font-weight: bold;">
        <%= t('Get Started') %>
      </a>
    </td>
  </tr>
</table>
