def reset_password_email(email, token, root_url)
    @email, @token, @host, @protocol = email, token
    @token = token
    @protocol, @host = *root_url.split('://', 2)
    @host.slice!(-1) if @host[-1] == ?/

    hostname = @host.split(':', 2).first  # Strip out any port.
    mail to: email, from: reset_password_from(token, hostname, @protocol),
         subject: reset_password_subject(token, hostname, @protocol)
  end
def reset_password_email(email, token, root_url)
    @email, @token, @host, @protocol = email, token
    @token = token
    @protocol, @host = *root_url.split('://', 2)
    @host.slice!(-1) if @host[-1] == ?/

    hostname = @host.split(':', 2).first  # Strip out any port.
    mail to: email, from: reset_password_from(token, hostname, @protocol),
         subject: reset_password_subject(token, hostname, @protocol)
  end
Creates an e-mail containing a password reset token.

 @param [String] email the email to send the token to
 @param [String] token the password reset token
 @param [String] root_url the application's root URL
     (e.g. "https://localhost:3000/")