<% define_content :link do %> <%= dashboard_url %> <% end %> <% define_content :subject do %> <%= t :subject, "Recent Canvas Notifications" %> <% end %> <% define_content :report_date do %> <%= (date_string(force_zone(m.send_at), :no_words) rescue t("#date.days.today_lower", "today")) %> <% end %> <% m = (delayed_messages || []).find{|m| m.frequency == Notification::FREQ_WEEKLY} || delayed_messages.first %> <% if !m || m.frequency == Notification::FREQ_DAILY %>

<%= t :daily_body, "You're signed up to receive a daily report of some notifications from your Canvas account. Below is the report for %{date}:", :date => content(:report_date) %>

<% elsif m.frequency == Notification::FREQ_WEEKLY %>

<%= t :weekly_body, "You're signed up to receive a weekly report of some notifications from your Canvas account. Below is the report for the week ending %{date}:", :date => content(:report_date) %>

<% end %> <% for delayed_message in delayed_messages do %>

<%= html_to_text(delayed_message.name_of_topic, :base_url => content(:link)) %>

<%= html_to_simple_html(delayed_message.summary, :base_url => content(:link)) %>

<%= t :view, "Click to view" %>

<% end %>