<% content_for :message do %> <% @seen = {} %> <% @seen_summary = {} %> <% @creations.each_with_index do |creation, index| %> <% this_work = creation.respond_to?(:work) ? creation.work : creation %> <% work_link = style_link(this_work.title, work_url(this_work)) %> <% cache("subscription-email-preface-#{creation.cache_key}") do %> <%= creator_links(this_work) %> posted a <% if creation.is_a?(Work) %> <%= this_work.backdate ? "backdated" : "new" %> work: <% else %> new chapter of <%= work_link %> (<%= this_work.word_count %> words): <% end %> <% end %>

<%= style_bold(creation.is_a?(Work) ? work_link : style_link(creation.full_chapter_title.html_safe, work_chapter_url(this_work, creation))) %> (<%= creation.word_count%> words) <% unless @seen[this_work.id] %>
by <%= creator_links(this_work) %> <% end %>

<% if creation.summary.present? && creation.is_a?(Chapter) %>

<%= style_bold("Chapter Summary:") %>

<%= style_quote(raw sanitize_field(creation, :summary)) %> <% end %> <% unless @seen[this_work.id] %> <% cache("subscription-email-meta-#{creation.cache_key}") do %>

<%= style_bold("Chapters:") %> <%= chapter_total_display(this_work) %>
<%= style_bold("Fandom:") %> <%= this_work.fandoms.map{|f| style_link(f.name, fandom_url(f))}.to_sentence.html_safe %>
<%= style_bold("Rating:") %> <%= this_work.rating_string %>
<%= style_bold("Warnings:") %> <%= this_work.archive_warning_string %> <% if this_work.relationship_string && !this_work.relationship_string.blank? %>
<%= style_bold("Relationships:") %> <%= this_work.relationship_string %> <% end %> <% if this_work.character_string && !this_work.character_string.blank? %>
<%= style_bold("Characters:") %> <%= this_work.character_string %> <% end %> <% if this_work.freeform_string && !this_work.freeform_string.blank? %>
<%= style_bold("Additional Tags:") %> <%= this_work.freeform_string %> <% end %> <% if this_work.series.count > 0 %>
<%= style_bold("Series:") %> <%= series_list_for_feeds(this_work).html_safe %> <% end %>

<% end %> <% @seen[this_work.id] = true %> <% end %> <% unless @seen_summary[this_work.id] || this_work.summary.blank? %>

<%= style_bold("Summary:") %>

<%= style_quote(raw sanitize_field(this_work, :summary)) %> <% @seen_summary[this_work.id] = true %> <% end %> <% if (index < @creations.length-1) %> <%= styled_divider %> <% end %> <% end %> <% end %> <% content_for :footer_note do %> You're receiving this email because you've subscribed to <%= style_footer_link(@subscription.name, polymorphic_url(@subscription.subscribable)) %>. Follow the link to unsubscribe if you no longer wish to receive updates. <% end %>