Mercurial > hg > soundsoftware-site
comparison app/models/mailer.rb @ 313:862e47cc1e09 live
Merge from branch "bug_97"
author | Chris Cannam |
---|---|
date | Mon, 28 Mar 2011 18:04:17 +0100 |
parents | 76c548e4e6e4 |
children | 350acce374a2 |
comparison
equal
deleted
inserted
replaced
312:8019c250165b | 313:862e47cc1e09 |
---|---|
29 def self.default_url_options | 29 def self.default_url_options |
30 h = Setting.host_name | 30 h = Setting.host_name |
31 h = h.to_s.gsub(%r{\/.*$}, '') unless Redmine::Utils.relative_url_root.blank? | 31 h = h.to_s.gsub(%r{\/.*$}, '') unless Redmine::Utils.relative_url_root.blank? |
32 { :host => h, :protocol => Setting.protocol } | 32 { :host => h, :protocol => Setting.protocol } |
33 end | 33 end |
34 | |
35 | |
36 | |
37 # Builds a tmail object used to email the specified user that he was added to a project | |
38 # | |
39 # Example: | |
40 # add_to_project(user) => tmail object | |
41 # Mailer.deliver_add_to_project(user) => sends an email to the registered user | |
42 def added_to_project(member, project) | |
43 | |
44 user = User.find(member.user_id) | |
45 | |
46 set_language_if_valid user.language | |
47 recipients user.mail | |
48 subject l(:mail_subject_added_to_project, Setting.app_title) | |
49 body :project_url => url_for(:controller => 'projects', :action => 'show', :id => project.id), | |
50 :project_name => project.name | |
51 render_multipart('added_to_project', body) | |
52 end | |
53 | |
54 | |
34 | 55 |
35 # Builds a tmail object used to email recipients of the added issue. | 56 # Builds a tmail object used to email recipients of the added issue. |
36 # | 57 # |
37 # Example: | 58 # Example: |
38 # issue_add(issue) => tmail object | 59 # issue_add(issue) => tmail object |
438 def add_message_id( fqdn = nil ) | 459 def add_message_id( fqdn = nil ) |
439 self.message_id ||= ::TMail::new_message_id(fqdn) | 460 self.message_id ||= ::TMail::new_message_id(fqdn) |
440 end | 461 end |
441 end | 462 end |
442 end | 463 end |
464 | |
465 | |
466 | |
467 |