Created
February 3, 2015 15:48
-
-
Save matiasmoya/3d15c6a0473f5780afda to your computer and use it in GitHub Desktop.
Send confirmation email callback w/devise. Confirmable module with allow login without confirmation
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
p Welcome #{@user.email}! | |
p You can confirm your account email through the link below: | |
p | |
= link_to 'Confirm my account', confirmation_url(@user, :confirmation_token => @token) |
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
def confirmation_email(user) | |
@user = user | |
@token = user.confirmation_token | |
mail(to: @user.email, subject: 'Please confirm your account') | |
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
after_create :send_confirmation_email | |
def send_confirmation_email | |
Sender.confirmation_emai(self).deliver | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment