-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
When a user creates an account, they are sent an activation email. This email contains link which, when clicked, activates the user and logs them in.
- Loading branch information
Rob Nagle
committed
Apr 11, 2010
1 parent
5fe741a
commit 3cd54c7
Showing
11 changed files
with
84 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
class ActivationMailer < ActionMailer::Base | ||
|
||
def activation_instructions(user, sent_at = Time.now) | ||
from "A-List Account Activation <[email protected]>" | ||
reply_to "[email protected]" | ||
recipients user.email | ||
subject "Activate Your A-List Account" | ||
body :account_activation_url => activate_url(user.perishable_token) | ||
end | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Thank you for creating an A-List account! Click the URL below to activate your account. | ||
|
||
<%= @account_activation_url %> | ||
|
||
If the above URL does not work try copying and pasting it into your browser. If you continue to have problem, please feel free to contact us. |
5 changes: 5 additions & 0 deletions
5
app/views/activation_mailer/activation_instructions.text.html.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<p>Thank you for creating an A-List account! Click the URL below to activate your account.</p> | ||
|
||
<p><%= link_to "Activate", @account_activation_url %></p> | ||
|
||
<p>If the above URL does not work try copying and pasting it into your browser. If you continue to have problem, please feel free to contact us.</p> |
5 changes: 5 additions & 0 deletions
5
app/views/activation_mailer/activation_instructions.text.plain.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Thank you for creating an A-List account! Click the URL below to activate your account. | ||
|
||
<%= link_to "Activate", @account_activation_url %> | ||
|
||
If the above URL does not work try copying and pasting it into your browser. If you continue to have problem, please feel free to contact us. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
ActivationMailer#activation_instructions | ||
|
||
Find me in app/views/activation_mailer/activation_instructions.erb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
require 'test_helper' | ||
|
||
class ActivationMailerTest < ActionMailer::TestCase | ||
test "activation_instructions" do | ||
@expected.subject = 'ActivationMailer#activation_instructions' | ||
@expected.body = read_fixture('activation_instructions') | ||
@expected.date = Time.now | ||
|
||
assert_equal @expected.encoded, ActivationMailer.create_activation_instructions(@expected.date).encoded | ||
end | ||
|
||
end |