Poodle.Client (poodle v1.0.0)
View SourceMain client for the Poodle SDK.
Provides high-level functions for sending emails through the Poodle API.
Summary
Functions
Send an email with both HTML and text content.
Send an email asynchronously.
Send an email using an Email struct.
Send an email using an Email struct asynchronously.
Send an HTML email.
Send an HTML email asynchronously.
Send a plain text email.
Send a plain text email asynchronously.
Functions
@spec send(String.t(), String.t(), String.t(), keyword()) :: {:ok, Poodle.Response.t()} | {:error, Poodle.Error.t()}
Send an email with both HTML and text content.
Examples
iex> Poodle.Client.send("from@example.com", "to@example.com", "Subject", html: "<h1>Hello</h1>", text: "Hello")
{:ok, %Poodle.Response{...}}
Send an email asynchronously.
Returns a Task that can be awaited for the result.
Examples
iex> task = Poodle.Client.send_async("from@example.com", "to@example.com", "Subject", html: "<h1>Hello</h1>")
iex> Task.await(task)
{:ok, %Poodle.Response{...}}
@spec send_email(Poodle.Email.t(), Poodle.Config.t() | nil, keyword()) :: {:ok, Poodle.Response.t()} | {:error, Poodle.Error.t()}
Send an email using an Email struct.
Examples
iex> email = %Poodle.Email{from: "from@example.com", to: "to@example.com", subject: "Subject", html: "<h1>Hello</h1>"}
iex> Poodle.Client.send_email(email)
{:ok, %Poodle.Response{...}}
@spec send_email_async(Poodle.Email.t(), Poodle.Config.t() | nil, keyword()) :: Task.t()
Send an email using an Email struct asynchronously.
Examples
iex> email = %Poodle.Email{from: "from@example.com", to: "to@example.com", subject: "Subject", html: "<h1>Hello</h1>"}
iex> task = Poodle.Client.send_email_async(email)
iex> Task.await(task)
{:ok, %Poodle.Response{...}}
@spec send_html(String.t(), String.t(), String.t(), String.t(), keyword()) :: {:ok, Poodle.Response.t()} | {:error, Poodle.Error.t()}
Send an HTML email.
Examples
iex> Poodle.Client.send_html("from@example.com", "to@example.com", "Subject", "<h1>Hello</h1>")
{:ok, %Poodle.Response{...}}
Send an HTML email asynchronously.
Examples
iex> task = Poodle.Client.send_html_async("from@example.com", "to@example.com", "Subject", "<h1>Hello</h1>")
iex> Task.await(task)
{:ok, %Poodle.Response{...}}
@spec send_text(String.t(), String.t(), String.t(), String.t(), keyword()) :: {:ok, Poodle.Response.t()} | {:error, Poodle.Error.t()}
Send a plain text email.
Examples
iex> Poodle.Client.send_text("from@example.com", "to@example.com", "Subject", "Hello")
{:ok, %Poodle.Response{...}}
Send a plain text email asynchronously.
Examples
iex> task = Poodle.Client.send_text_async("from@example.com", "to@example.com", "Subject", "Hello")
iex> Task.await(task)
{:ok, %Poodle.Response{...}}