To check out this repository please hg clone the following URL, or open the URL using EasyMercurial or your preferred Mercurial client.

Statistics Download as Zip
| Branch: | Tag: | Revision:

root / vendor / plugins / redmine_bibliography / lib / bibliography / mailer_patch.rb @ 1072:872db7098cb9

History | View | Annotate | Download (986 Bytes)

1
require_dependency 'mailer'
2

    
3
module Bibliography
4
  module MailerPatch
5
      def self.included(base) # :nodoc:
6

    
7
        # Builds a tmail object used to email the specified user that a publication was created and the user is 
8
        # an author of that publication
9
        #
10
        # Example:
11
        #   publication_added(user) => tmail object
12
        #   Mailer.deliver_add_to_project(user) => sends an email to the registered user
13
        def publication_added(user, publication, project)
14

    
15
          @publication = publication
16
          @project = project
17

    
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

    
24
          render_multipart('publication_added', body)
25

    
26
        end
27
        
28
        
29
    end
30
  end
31
end