Project

General

Profile

Actions

Feature #33002

closed

Include attachments in news post notifications

Added by Виктор Воеводский almost 5 years ago. Updated over 4 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Email notifications
Target version:
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

Related to Redmine - Feature #16006: Include attachments in forum post notificationsClosedGo MAEDA

Actions
Actions #1

Updated by Go MAEDA almost 5 years ago

  • Category changed from News to Email notifications
Actions #2

Updated by Go MAEDA almost 5 years ago

  • Related to Feature #16006: Include attachments in forum post notifications added
Actions #3

Updated by Yuichi HARADA almost 5 years ago

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
Actions #4

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.

Actions #5

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

Also available in: Atom PDF