View Source URL.Mailto (URL v1.5.0)

Parses a mailto URL

Summary

Functions

Parse a URI with the :scheme of "tel"

Types

@type t() :: %URL.Mailto{params: map(), to: [binary(), ...]}

Functions

@spec parse(URI.t()) :: t() | {:error, {module(), binary()}}

Parse a URI with the :scheme of "tel"

Example

iex> mailto = URI.parse("mailto:user@%E7%B4%8D%E8%B1%86.example.org?subject=Test&body=NATTO")
iex> URL.Mailto.parse(mailto)
%URL.Mailto{
  params: %{"body" => "NATTO", "subject" => "Test"},
  to: ["user@納豆.example.org"]
}