Skip to content
This repository has been archived by the owner on Mar 3, 2021. It is now read-only.

Commit

Permalink
confirmation email template
Browse files Browse the repository at this point in the history
  • Loading branch information
Zac Williams committed Dec 13, 2010
1 parent b2aecdd commit f7a8094
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 3 deletions.
3 changes: 3 additions & 0 deletions app/mailers/user_mailer.rb
@@ -1,6 +1,9 @@
class UserMailer < ActionMailer::Base

def confirmation_instructions(user)

@user = user

mail(:to => user.email,
:subject => Spree::Config[:site_name] + ' ' + t("confirmation_instructions"))
end
Expand Down
5 changes: 5 additions & 0 deletions app/views/user_mailer/confirmation_instructions.html.erb
@@ -0,0 +1,5 @@
<p>Welcome to <%= Spree::Config[:site_name] %>!</p>

<p>Please confirm your your email address by clicking on the link below:</p>

<p><%= user_confirmation_url(@user.confirmation_token) %></p>
2 changes: 1 addition & 1 deletion app/views/users/_resend_confirmation.html.erb
@@ -1,7 +1,7 @@
<% if @user.confirmed_at.nil? %>
<div class="flash notice">
<p><%= t("unconfirmed_account") %></p>
<%= form_for(:user, :url => user_confirmation_path, :html => { :method => :post }) do |f| %>
<%= form_for(:user, :url => create_user_confirmation_path, :html => { :method => :post }) do |f| %>
<p><%= f.submit t("resend_confirmation_instructions") %></p>
<% end %>
</div>
Expand Down
1 change: 1 addition & 0 deletions config/locales/en.yml
Expand Up @@ -3,6 +3,7 @@ en:
account_confirmation_successful: "You email address has been confirmed!"
already_confirmed: "Email address has already been confirmed."
claim_it: "Claim It!"
confirm_it: "Confirm It!"
instructions_sent_success: "Confirmation Instructions Sent."
invalid_token: "Invalid Confirmation Token."
order_claim_failure: "Error Claiming Order."
Expand Down
4 changes: 2 additions & 2 deletions config/routes.rb
@@ -1,8 +1,8 @@
Rails.application.routes.draw do

devise_scope :user do
post "/user_confirmation" => "user_confirmations#create", :as => :user_confirmation
get "/user_confirmation/:confirmation_token" => "user_confirmations#show"
post "/user_confirmation" => "user_confirmations#create", :as => :create_user_confirmation
get "/user_confirmation/:confirmation_token" => "user_confirmations#show", :as => :user_confirmation
end

match 'orders/:id/claim' => 'orders#claim', :via => :put, :as => :claim_order
Expand Down

0 comments on commit f7a8094

Please sign in to comment.