Actions
Feature #33002
closedInclude attachments in news post notifications
Start date:
Due date:
% Done:
0%
Estimated time:
Resolution:
Fixed
Description
There are no files in news notifications. Can this be implemented as in Issue?
Files
Related issues
Updated by Go MAEDA almost 5 years ago
- Category changed from News to Email notifications
Updated by Go MAEDA almost 5 years ago
- Related to Feature #16006: Include attachments in forum post notifications added
Updated by Yuichi HARADA almost 5 years ago
- File 33002-include-attachments-in-news-added-notifications.patch 33002-include-attachments-in-news-added-notifications.patch added
- File news-notification-include-attachments.png news-notification-include-attachments.png 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
Updated by Go MAEDA almost 5 years ago
- 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.
Updated by Go MAEDA over 4 years ago
- Status changed from New to Closed
- Assignee set to Go MAEDA
- Resolution set to Fixed
Committed the patch. Thank you.
Actions