Skip to content

Commit

Permalink
fix for custom name in user_mailer generator [#882 state:resolved]
Browse files Browse the repository at this point in the history
  • Loading branch information
ddnexus committed Dec 19, 2010
1 parent d90957a commit 1843311
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 16 deletions.
4 changes: 2 additions & 2 deletions hobo/lib/generators/hobo/user_mailer/templates/activation.erb
@@ -1,8 +1,8 @@
<%%= @user %>,
<%%= @<%= name.underscore -%> %>,

To activate your account for <%%= @app_name %>, click on this link:

<%%= user_activate_url :id => @user, :key => @key %>
<%%= <%= name.underscore -%>_activate_url :id => @<%= name.underscore -%>, :key => @key %>

Thank you,

Expand Down
@@ -1,9 +1,9 @@
<%%= @user %>,
<%%= @<%= name.underscore -%> %>,

If you have forgotten your password for <%%= @app_name %>, you can choose
a new one by clicking on this link:

<%%= <%= name.underscore -%>_reset_password_url :id => @user, :key => @key %>
<%%= <%= name.underscore -%>_reset_password_url :id => @<%= name.underscore -%>, :key => @key %>

Thank you,

Expand Down
4 changes: 2 additions & 2 deletions hobo/lib/generators/hobo/user_mailer/templates/invite.erb
@@ -1,8 +1,8 @@
<%%= @user %>,
<%%= @<%= name.underscore %> %>,

You have been invited to join <%%= @app_name %>. If you wish to accept, please click on the following link

<%%= user_accept_invitation_url :id => @user, :key => @key %>
<%%= <%= name.underscore %>_accept_invitation_url :id => @<%= name.underscore %>, :key => @key %>

Thank you,

Expand Down
20 changes: 10 additions & 10 deletions hobo/lib/generators/hobo/user_mailer/templates/mailer.rb.erb
@@ -1,24 +1,24 @@
class <%= class_name -%>Mailer < ActionMailer::Base
default :from => "no-reply@#{host}"

def forgot_password(user, key)
@user, @key = user, key
def forgot_password(<%= name.underscore %>, key)
@<%= name.underscore %>, @key = <%= name.underscore %>, key
mail( :subject => "#{app_name} -- forgotten password",
:to => user.email_address )
:to => <%= name.underscore %>.email_address )
end

<% if invite_only? -%>
def invite(user, key)
@user, @key = user, key
def invite(<%= name.underscore %>, key)
@<%= name.underscore %>, @key = <%= name.underscore %>, key
mail( :subject => "Invitation to #{app_name}",
:to => user.email_address )
:to => <%= name.underscore %>.email_address )
end

<% elsif options[:activation_email] %>
def activation(user, key)
@user, @key = user, key
mail :subject => "#{app_name} -- activate",
:to => user.email_address
def activation(<%= name.underscore %>, key)
@<%= name.underscore %>, @key = <%= name.underscore %>, key
mail( :subject => "#{app_name} -- activate",
:to => <%= name.underscore %>.email_address )
end

<% end -%>
Expand Down

0 comments on commit 1843311

Please sign in to comment.