Skip to content

Instantly share code, notes, and snippets.

@matiasmoya
Created February 3, 2015 15:48
Show Gist options
  • Save matiasmoya/3d15c6a0473f5780afda to your computer and use it in GitHub Desktop.
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
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)
def confirmation_email(user)
@user = user
@token = user.confirmation_token
mail(to: @user.email, subject: 'Please confirm your account')
end
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