Diff
Modified: trunk/app/helpers/application_helper.rb (2275 => 2276)
--- trunk/app/helpers/application_helper.rb 2009-09-17 15:28:30 UTC (rev 2275)
+++ trunk/app/helpers/application_helper.rb 2009-09-30 14:44:59 UTC (rev 2276)
@@ -1548,4 +1548,9 @@
strings[0..-2].join(", ") + " and " + strings[-1]
end
+ def login_identity_reminder(user)
+ return "Your username is: #{user.username}" if user.username
+ return "Your OpenID URL is: #{user.openid_url}" if user.openid_url
+ end
+
end
Modified: trunk/app/models/mailer.rb (2275 => 2276)
--- trunk/app/models/mailer.rb 2009-09-17 15:28:30 UTC (rev 2275)
+++ trunk/app/models/mailer.rb 2009-09-30 14:44:59 UTC (rev 2276)
@@ -18,7 +18,7 @@
subject "Welcome to #{Conf.sitename}. Please activate your account."
body :name => user.name,
- :username => user.username,
+ :user => user,
:hash => hash,
:base_url => base_url
end
@@ -29,7 +29,7 @@
subject "#{Conf.sitename} - Reset Password Request"
body :name => user.name,
- :username => user.username,
+ :user => user,
:reset_code => user.reset_password_code,
:base_url => base_url
@@ -41,7 +41,7 @@
subject "#{Conf.sitename} - Update Email Address on Account"
body :name => user.name,
- :username => user.username,
+ :user => user,
:hash => hash,
:base_url => base_url,
:email => user.unconfirmed_email
Modified: trunk/app/models/notifier.rb (2275 => 2276)
--- trunk/app/models/notifier.rb 2009-09-17 15:28:30 UTC (rev 2275)
+++ trunk/app/models/notifier.rb 2009-09-30 14:44:59 UTC (rev 2276)
@@ -1,5 +1,7 @@
class Notifier < ActionMailer::Base
+ helper :application
+
def friendship_request(user, friend_name, friendship, base_url)
recipients user.email
from Conf.notifications_email_address
@@ -8,7 +10,8 @@
body :user => user,
:friend_name => friend_name,
:friendship => friendship,
- :base_url => base_url
+ :base_url => base_url,
+ :target => user
end
def membership_invite(user, network, membership, base_url)
@@ -19,7 +22,8 @@
body :user => user,
:network => network,
:membership => membership,
- :base_url => base_url
+ :base_url => base_url,
+ :target => user
end
def membership_request(requestor, network, membership, base_url)
@@ -31,7 +35,8 @@
:network => network,
:base_url => base_url,
:membership => membership,
- :requestor => requestor
+ :requestor => requestor,
+ :target => network.owner
end
def auto_join_group(member, network, base_url)
@@ -40,10 +45,10 @@
subject "#{Conf.sitename} - #{member.name} has joined the #{network.title} Group"
body :name => network.owner.name,
- :username => network.owner.username,
:network => network,
:base_url => base_url,
- :member_name => member.name
+ :member_name => member.name,
+ :target => network.owner
end
def new_message(message, base_url)
@@ -56,7 +61,8 @@
:from_name => message.u_from.name,
:base_url => base_url,
:subject => message.subject,
- :message_id => message.id
+ :message_id => message.id,
+ :target => message.u_to
end
end
Modified: trunk/app/views/mailer/account_confirmation.rhtml (2275 => 2276)
--- trunk/app/views/mailer/account_confirmation.rhtml 2009-09-17 15:28:30 UTC (rev 2275)
+++ trunk/app/views/mailer/account_confirmation.rhtml 2009-09-30 14:44:59 UTC (rev 2276)
@@ -2,7 +2,7 @@
Thank you for registering with <%= Conf.sitename %>.
-Your username is: <%= @username %>
+ <%= login_identity_reminder(@user) %>
To confirm your email address and activate your account, please follow the link below (you might need to copy/paste it into your browser):
Modified: trunk/app/views/mailer/forgot_password.rhtml (2275 => 2276)
--- trunk/app/views/mailer/forgot_password.rhtml 2009-09-17 15:28:30 UTC (rev 2275)
+++ trunk/app/views/mailer/forgot_password.rhtml 2009-09-30 14:44:59 UTC (rev 2276)
@@ -2,7 +2,7 @@
A password reset has been requested for your account.
-Username: <%= @username %>
+ <%= login_identity_reminder(@user) %>
Follow the link below to reset your password (you might need to copy/paste it into your browser):
Modified: trunk/app/views/mailer/update_email_address.rhtml (2275 => 2276)
--- trunk/app/views/mailer/update_email_address.rhtml 2009-09-17 15:28:30 UTC (rev 2275)
+++ trunk/app/views/mailer/update_email_address.rhtml 2009-09-30 14:44:59 UTC (rev 2276)
@@ -2,7 +2,7 @@
You have requested to update your email address on <%= Conf.sitename %> to: <%= @email %>
-Username: <%= @username %>
+ <%= login_identity_reminder(@user) %>
Please confirm this by following the link below (you might need to copy/paste it into your browser). Your old email address will be active until you have done this.
Modified: trunk/app/views/notifier/auto_join_group.rhtml (2275 => 2276)
--- trunk/app/views/notifier/auto_join_group.rhtml 2009-09-17 15:28:30 UTC (rev 2275)
+++ trunk/app/views/notifier/auto_join_group.rhtml 2009-09-30 14:44:59 UTC (rev 2276)
@@ -7,7 +7,7 @@
Note that <%= @member_name %> was able to join this Group because you have set it to automatically accept all Membership Requests.
-Your username is: <%= @username %>
+ <%= login_identity_reminder(@target) %>
Thanks,
Modified: trunk/app/views/notifier/friendship_request.rhtml (2275 => 2276)
--- trunk/app/views/notifier/friendship_request.rhtml 2009-09-17 15:28:30 UTC (rev 2275)
+++ trunk/app/views/notifier/friendship_request.rhtml 2009-09-30 14:44:59 UTC (rev 2276)
@@ -4,7 +4,7 @@
Please go to <%= "http://" + @base_url + user_friendship_path(@user, @friendship) %> to confirm/reject this request.
-Your username is: <%= @user.username %>
+ <%= login_identity_reminder(@target) %>
Thanks,
Modified: trunk/app/views/notifier/membership_invite.rhtml (2275 => 2276)
--- trunk/app/views/notifier/membership_invite.rhtml 2009-09-17 15:28:30 UTC (rev 2275)
+++ trunk/app/views/notifier/membership_invite.rhtml 2009-09-30 14:44:59 UTC (rev 2276)
@@ -7,7 +7,7 @@
Please go to <%= "http://" + @base_url + membership_path(@user, @membership) %> to confirm/reject this invite.
-Your username is: <%= @user.username %>
+ <%= login_identity_reminder(@target) %>
Thanks,
Modified: trunk/app/views/notifier/membership_request.rhtml (2275 => 2276)
--- trunk/app/views/notifier/membership_request.rhtml 2009-09-17 15:28:30 UTC (rev 2275)
+++ trunk/app/views/notifier/membership_request.rhtml 2009-09-30 14:44:59 UTC (rev 2276)
@@ -7,7 +7,7 @@
Please go to <%= "http://" + @base_url + user_membership_path(@requestor, @membership) %> to confirm/reject this request.
-Your username is: <%= @user.username %>
+ <%= login_identity_reminder(@target) %>
Thanks,
Modified: trunk/app/views/notifier/new_message.rhtml (2275 => 2276)
--- trunk/app/views/notifier/new_message.rhtml 2009-09-17 15:28:30 UTC (rev 2275)
+++ trunk/app/views/notifier/new_message.rhtml 2009-09-30 14:44:59 UTC (rev 2276)
@@ -7,7 +7,7 @@
Please go to <%= url_for : false, :host => @base_url, :controller => 'messages', :id => @message_id, :action ="" 'show' %> to view the message.
Note that you may be asked to log in to see and reply to this message.
-Your username is: <%= @username %>
+ <%= login_identity_reminder(@target) %>
Thanks,