Feature #33002
closed
Include attachments in news post notifications
Added by Виктор Воеводский almost 5 years ago.
Updated over 4 years ago.
Category:
Email notifications
Description
There are no files in news notifications. Can this be implemented as in Issue?
Files
- Category changed from News to Email notifications
- Related to Feature #16006: Include attachments in forum post notifications added
I included the attachments in the notifications when the news was added.
diff --git a/app/views/mailer/news_added.html.erb b/app/views/mailer/news_added.html.erb
index daf250adf..992321930 100644
--- a/app/views/mailer/news_added.html.erb
+++ b/app/views/mailer/news_added.html.erb
@@ -2,3 +2,11 @@
<em><%= @news.author.name %></em>
<%= textilizable(@news, :description, :only_path => false) %>
+
+<% if @news.attachments.any? -%>
+<fieldset class="attachments"><legend><%= l(:label_attachment_plural) %></legend>
+<% @news.attachments.each do |attachment| -%>
+ <%= link_to_attachment attachment, :download => true, :only_path => false %> (<%= number_to_human_size(attachment.filesize) %>)<br />
+<% end -%>
+</fieldset>
+<% end -%>
\ No newline at end of file
diff --git a/app/views/mailer/news_added.text.erb b/app/views/mailer/news_added.text.erb
index c8ae3035f..65e6a404f 100644
--- a/app/views/mailer/news_added.text.erb
+++ b/app/views/mailer/news_added.text.erb
@@ -3,3 +3,10 @@
<%= @news.author.name %>
<%= @news.description %>
+
+<% if @news.attachments.any? -%>
+---<%= l(:label_attachment_plural).ljust(37, '-') %>
+<% @news.attachments.each do |attachment| -%>
+<%= attachment.filename %> (<%= number_to_human_size(attachment.filesize) %>)
+<% end -%>
+<% end -%>
\ No newline at end of file
- Subject changed from News attachments in mail. to Include attachments in news post notifications
- Target version set to 4.2.0
LGTM. Setting the target version to 4.2.0.
- Status changed from New to Closed
- Assignee set to Go MAEDA
- Resolution set to Fixed
Committed the patch. Thank you.
Also available in: Atom
PDF