It depends on when you send the email. If you do this at the same time as sending a regular confirmation message (so, in the same run loop as when creating the user), you should have access to the token by adding it to your user model:
def get_raw_confirmation_token
return @raw_confirmation_token
end
If you send your subsequent email later, you will not be able to receive the existing confirmation token. It is stored in the database as a one-way hash for security purposes. However, you can create a new confirmation token and send it to your subsequent email. Add a new method to the user model as follows:
def generate_new_confirmation_token
unless @raw_confirmation_token
generate_confirmation_token!
end
return @raw_confirmation_token
end
, . Devise , resend_confirmation_instructions , - , .