Revision 1402:5cb7eeccede1

View differences:

plugins/redmine_bibliography/app/models/publication.rb
53 53
  def notify_authors_publication_added(project)
54 54
    self.authors.each do |author|
55 55
      Rails.logger.debug { "Sending mail to \"#{self.title}\" publication authors." }
56
      Mailer.deliver_publication_added(author.user, self, project) unless author.user.nil?
56
      Mailer.publication_added(author.user, self, project).deliver unless author.user.nil?
57 57
    end
58 58
  end
59 59

  
60 60
  def notify_authors_publication_updated(project)
61 61
    self.authors.each do |author|
62 62
      Rails.logger.debug { "Sending mail to \"#{self.title}\" publication authors." }
63
      Mailer.deliver_publication_updated(author.user, self, project) unless author.user.nil?
63
      Mailer.publication_updated(author.user, self, project).deliver unless author.user.nil?
64 64
    end
65 65
  end
66 66

  
plugins/redmine_bibliography/lib/bibliography/mailer_patch.rb
4 4
  module MailerPatch
5 5
      def self.included(base) # :nodoc:
6 6

  
7
        # Builds a tmail object used to email the specified user that a publication was created and the user is 
7
        # Builds a tmail object used to email the specified user that a publication was created and the user is
8 8
        # an author of that publication
9 9
        #
10 10
        # Example:
......
16 16
          @project = project
17 17

  
18 18
          set_language_if_valid user.language
19
          recipients user.mail
20
          subject l(:mail_subject_publication_added, Setting.app_title)
21
          body :publication_url => url_for( :controller => 'publications', :action => 'show', :id => publication.id ),
22
              :publication_title => publication.title
23 19

  
24
          render_multipart('publication_added', body)
20
          mail :to => user.mail,
21
          :subject => l(:mail_subject_register, Setting.app_title)
25 22

  
23
          @publication_url = url_for( :controller => 'publications', :action => 'show', :id => publication.id )
24
          @publication_title = publication.title
26 25
        end
27
        
28
        
26

  
27

  
29 28
    end
30 29
  end
31 30
end

Also available in: Unified diff