To check out this repository please hg clone the following URL, or open the URL using EasyMercurial or your preferred Mercurial client.
root / plugins / redmine_bibliography / lib / bibliography / mailer_patch.rb @ 1443:ea2a09a0fd90
History | View | Annotate | Download (900 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 |
|
| 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
|