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 / plugins / redmine_bibliography / lib / bibliography / mailer_patch.rb @ 1431:303b9be118d4

History | View | Annotate | Download (900 Bytes)

1 651:f029431de4dd luis
require_dependency 'mailer'
2
3
module Bibliography
4
  module MailerPatch
5
      def self.included(base) # :nodoc:
6
7 1400:581999ce44ea luis
        # Builds a tmail object used to email the specified user that a publication was created and the user is
8 651:f029431de4dd luis
        # 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 666:865d079e5fa0 luis
        def publication_added(user, publication, project)
14 651:f029431de4dd luis
15
          @publication = publication
16 666:865d079e5fa0 luis
          @project = project
17 651:f029431de4dd luis
18
          set_language_if_valid user.language
19 666:865d079e5fa0 luis
20 1400:581999ce44ea luis
          mail :to => user.mail,
21
          :subject => l(:mail_subject_register, Setting.app_title)
22 666:865d079e5fa0 luis
23 1400:581999ce44ea luis
          @publication_url = url_for( :controller => 'publications', :action => 'show', :id => publication.id )
24
          @publication_title = publication.title
25 651:f029431de4dd luis
        end
26 1400:581999ce44ea luis
27
28 651:f029431de4dd luis
    end
29
  end
30
end