changeset 1402:5cb7eeccede1 biblio_alt_search_auth

merged from 'luisf' branch
author luisf <luis.figueira@eecs.qmul.ac.uk>
date Mon, 30 Sep 2013 13:53:20 +0100
parents 6106c49c5f50 (current diff) 95bdaaab97ca (diff)
children 35732ac4324a
files
diffstat 2 files changed, 9 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/redmine_bibliography/app/models/publication.rb	Mon Sep 30 13:50:17 2013 +0100
+++ b/plugins/redmine_bibliography/app/models/publication.rb	Mon Sep 30 13:53:20 2013 +0100
@@ -53,14 +53,14 @@
   def notify_authors_publication_added(project)
     self.authors.each do |author|
       Rails.logger.debug { "Sending mail to \"#{self.title}\" publication authors." }
-      Mailer.deliver_publication_added(author.user, self, project) unless author.user.nil?
+      Mailer.publication_added(author.user, self, project).deliver unless author.user.nil?
     end
   end
 
   def notify_authors_publication_updated(project)
     self.authors.each do |author|
       Rails.logger.debug { "Sending mail to \"#{self.title}\" publication authors." }
-      Mailer.deliver_publication_updated(author.user, self, project) unless author.user.nil?
+      Mailer.publication_updated(author.user, self, project).deliver unless author.user.nil?
     end
   end
 
--- a/plugins/redmine_bibliography/lib/bibliography/mailer_patch.rb	Mon Sep 30 13:50:17 2013 +0100
+++ b/plugins/redmine_bibliography/lib/bibliography/mailer_patch.rb	Mon Sep 30 13:53:20 2013 +0100
@@ -4,7 +4,7 @@
   module MailerPatch
       def self.included(base) # :nodoc:
 
-        # Builds a tmail object used to email the specified user that a publication was created and the user is 
+        # Builds a tmail object used to email the specified user that a publication was created and the user is
         # an author of that publication
         #
         # Example:
@@ -16,16 +16,15 @@
           @project = project
 
           set_language_if_valid user.language
-          recipients user.mail
-          subject l(:mail_subject_publication_added, Setting.app_title)
-          body :publication_url => url_for( :controller => 'publications', :action => 'show', :id => publication.id ),
-              :publication_title => publication.title
 
-          render_multipart('publication_added', body)
+          mail :to => user.mail,
+          :subject => l(:mail_subject_register, Setting.app_title)
 
+          @publication_url = url_for( :controller => 'publications', :action => 'show', :id => publication.id )
+          @publication_title = publication.title
         end
-        
-        
+
+
     end
   end
 end