Wrong email notifications' issuer

This commit is contained in:
Karel Pičman 2019-03-25 13:09:39 +01:00
parent 4beeedd282
commit fff4957f44
5 changed files with 8 additions and 5 deletions

View File

@ -39,6 +39,7 @@ class DmsfMailer < Mailer
@files = files @files = files
@project = project @project = project
@author = files.first.last_revision.user if files.first.last_revision @author = files.first.last_revision.user if files.first.last_revision
@author = User.anonymous unless @author
message_id project message_id project
set_language_if_valid user.language set_language_if_valid user.language
mail :to => user.mail, subject: "[#{@project.name} - #{l(:menu_dmsf)}] #{l(:text_email_doc_updated_subject)}" mail :to => user.mail, subject: "[#{@project.name} - #{l(:menu_dmsf)}] #{l(:text_email_doc_updated_subject)}"
@ -60,6 +61,7 @@ class DmsfMailer < Mailer
@files = files @files = files
@project = project @project = project
@author = files.first.deleted_by_user @author = files.first.deleted_by_user
@author = User.anonymous unless @author
message_id project message_id project
set_language_if_valid user.language set_language_if_valid user.language
mail :to => user.mail, mail :to => user.mail,
@ -68,7 +70,7 @@ class DmsfMailer < Mailer
end end
def self.deliver_send_documents(project, email_params, author) def self.deliver_send_documents(project, email_params, author)
send_documents(User.current, project, email_params).deliver_now send_documents(User.current, project, email_params, author).deliver_now
end end
def send_documents(_, project, email_params, author) def send_documents(_, project, email_params, author)
@ -109,6 +111,7 @@ class DmsfMailer < Mailer
@text2 = l(text2_id) @text2 = l(text2_id)
@notice = notice @notice = notice
@author = User.find_by(id: revision.dmsf_workflow_assigned_by) @author = User.find_by(id: revision.dmsf_workflow_assigned_by)
@author = User.anonymous unless @author
mail :to => user.mail, mail :to => user.mail,
:subject => "[#{@project.name} - #{l(:field_label_dmsf_workflow)}] #{@workflow.name} #{l(subject_id)}" :subject => "[#{@project.name} - #{l(:field_label_dmsf_workflow)}] #{@workflow.name} #{l(subject_id)}"
end end

View File

@ -18,7 +18,7 @@
# along with this program; if not, write to the Free Software # along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.%> # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.%>
<%= link_to @author, user_url(@author) %> <%= l(:text_email_doc_deleted) if @author%> <%= link_to @author, user_url(@author) %> <%= l(:text_email_doc_deleted) %>
<%= link_to @project, project_url(@project) %> <%= l(:text_email_doc_follows) %> <%= link_to @project, project_url(@project) %> <%= l(:text_email_doc_follows) %>
<% @files.each do |file| %> <% @files.each do |file| %>
<p> <p>

View File

@ -21,7 +21,7 @@
# along with this program; if not, write to the Free Software # along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.%> # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.%>
<%= @author.name %> <%= l(:text_email_doc_deleted) %> <%= @project.name %> <%= l(:text_email_doc_follows) if @author %> <%= @author.name %> <%= l(:text_email_doc_deleted) %> <%= @project.name %> <%= l(:text_email_doc_follows) %>
<% @files.each do |file| %> <% @files.each do |file| %>
<%= h(file.dmsf_path_str) %> (<%= file.name %>) <%= h(file.dmsf_path_str) %> (<%= file.name %>)
<% if file.last_revision %> <% if file.last_revision %>

View File

@ -18,7 +18,7 @@
# along with this program; if not, write to the Free Software # along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.%> # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.%>
<%= link_to @author, user_url(@author) %> <%= l(:text_email_doc_updated) if @author%> <%= link_to @author, user_url(@author) %> <%= l(:text_email_doc_updated) %>
<%= link_to @project, project_url(@project) %> <%= l(:text_email_doc_follows) %> <%= link_to @project, project_url(@project) %> <%= l(:text_email_doc_follows) %>
<% @files.each do |file| %> <% @files.each do |file| %>
<p> <p>

View File

@ -18,7 +18,7 @@
# along with this program; if not, write to the Free Software # along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.%> # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.%>
<%= @author.name %> <%= l(:text_email_doc_updated) if @author %> <%= @author.name %> <%= l(:text_email_doc_updated) %>
<%= @project.name %> <%= l(:text_email_doc_follows) %> <%= @project.name %> <%= l(:text_email_doc_follows) %>
<% @files.each do |file| %> <% @files.each do |file| %>
<%= h(file.dmsf_path_str) %> (<%= file.name %>), <%= h(file.dmsf_path_str) %> (<%= file.name %>),