def email_verification_email(token, root_url)
    @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: @token.email,
         subject: email_verification_subject(token, hostname, @protocol),
         from: email_verification_from(token, hostname, @protocol)
  end
def email_verification_email(token, root_url)
    @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: @token.email,
         subject: email_verification_subject(token, hostname, @protocol),
         from: email_verification_from(token, hostname, @protocol)
  end
Creates an e-mail containing a verification token for the e-mail address.

 @param [String] token the e-mail confirmation token
 @param [String] the application's root URL (e.g. "https://localhost:3000/")