1 class Notifier < ActionMailer::Base
3 def signup_confirm( user, token )
4 @recipients = user.email
5 @from = 'abuse@openstreetmap.org'
6 @subject = '[OpenStreetMap] Confirm your email address'
7 @body['url'] = "http://#{SERVER_URL}/user/confirm?confirm_string=#{token.token}"
10 def lost_password( user, token )
11 @recipients = user.email
12 @from = 'abuse@openstreetmap.org'
13 @subject = '[OpenStreetMap] Password reset request'
14 @body['url'] = "http://#{SERVER_URL}/user/reset_password?email=#{user.email}&token=#{token.token}"
17 def reset_password(user, pass)
18 @recipients = user.email
19 @from = 'abuse@openstreetmap.org'
20 @subject = '[OpenStreetMap] Password reset'
24 def gpx_success(trace, possible_points)
25 @recipients = trace.user.email
26 @from = 'abuse@openstreetmap.org'
27 @subject = '[OpenStreetMap] GPX Import success'
28 @body['trace_name'] = trace.name
29 @body['trace_points'] = trace.size
30 @body['possible_points'] = possible_points
33 def gpx_failure(trace, error)
34 @recipients = trace.user.email
35 @from = 'abuse@openstreetmap.org'
36 @subject = '[OpenStreetMap] GPX Import failure'
37 @body['trace_name'] = trace.name
38 @body['error'] = error
41 def message_notification(message)
42 @from_user = User.find(message.from_user_id)
43 @to_user = User.find(message.to_user_id)
44 @recipients = @to_user.email
45 @from = 'abuse@openstreetmap.org'
46 @subject = "[OpenStreetMap] #{@from_user.display_name} sent you a new message"
47 @body['to_user'] = @to_user.display_name
48 @body['from_user'] = @from_user.display_name
49 @body['subject'] = message.title
50 @body['url'] = "http://#{SERVER_URL}/message/read/#{message.id}"