View Source URL.Mailto (URL v2.0.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()) :: {:ok, 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)
{:ok,
 %URL.Mailto{
   to: ["user@納豆.example.org"],
   params: %{"body" => "NATTO", "subject" => "Test"}
 }}