Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

adding some email stuff, etc.

  • Loading branch information...
commit 493da19da2252ccaeef79c676b8de304e78d95fe 1 parent bb68832
@mockdeep mockdeep authored
View
2  app/controllers/users_controller.rb
@@ -8,7 +8,7 @@ def new
def create
@user = User.new(params[:user])
if @user.save
- Notifier.signup_email(@user).deliver
+ Notifier.welcome(@user).deliver
self.current_user = @user
redirect_to root_path, :notice => "Signed up!"
else
View
8 app/mailers/notifier.rb
@@ -1,10 +1,10 @@
class Notifier < ActionMailer::Base
- default :from => "yay@tithe.boon.gl"
+ default :from => "Tithe <welcome@tithe.boon.gl>"
# send a signup email to the user, pass in the user object that contains the user's email address
- def signup_email(user)
- mail( :to => user.email,
- :subject => "Thanks for signing up" )
+ def welcome(user)
+ @user = user
+ mail( :to => user.email, :subject => "Welcome to Tithe!" )
end
end
View
11 app/views/notifier/welcome.html.haml
@@ -0,0 +1,11 @@
+%h3 Hi, #{@user.first_name}!
+
+%p
+ Thanks so much for joining Tithe! Let's get started contributing:
+
+%h3= link_to("Tithe", "http://tithe.boon.gl")
+
+%p
+ Cheers!
+ %br
+ The Tithe team
View
8 app/views/users/new.html.haml
@@ -8,6 +8,14 @@
- @user.errors.full_messages.each do |message|
%li= message
%p
+ = f.label :first_name
+ %br
+ = f.text_field :first_name
+ %p
+ = f.label :last_name
+ %br
+ = f.text_field :last_name
+ %p
= f.label :email
= f.text_field :email
%p
Please sign in to comment.
Something went wrong with that request. Please try again.