comparison plugins/redmine_bibliography/lib/bibliography/mailer_patch.rb @ 1484:51364c0cd58f redmine-2.4-integration

Merge from live branch. Still need to merge manually in files overridden by plugins.
author Chris Cannam
date Wed, 15 Jan 2014 09:59:14 +0000
parents 581999ce44ea
children a59e53e4f006
comparison
equal deleted inserted replaced
1464:261b3d9a4903 1484:51364c0cd58f
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
20 mail :to => user.mail,
21 :subject => l(:mail_subject_register, Setting.app_title)
22
23 @publication_url = url_for( :controller => 'publications', :action => 'show', :id => publication.id )
24 @publication_title = publication.title
25 end
26
27
28 end
29 end
30 end