LoopsEx.Events (LoopsEx v0.1.0)
View SourceTrigger email sending with events.
Summary
Types
Response type returned by Loops API calls
Functions
Send an event to trigger emails via Loops.
Types
@type response() :: LoopsEx.Client.response()
Response type returned by Loops API calls
Functions
Send an event to trigger emails via Loops.
Parameters
params
(map): must include:email
oruserId
to identify the contact.eventName
(string): the name of the event.- Optional
eventProperties
(map): event-specific data. - Optional
mailingLists
(map): mailing list subscriptions.
Returns
{:ok, %{"success" => true}}
on success.{:error, {status_code, response_body}}
on failure.
Example
iex> LoopsEx.Events.send_event(%{
"email" => "john@example.com",
"eventName" => "signup",
"eventProperties" => %{"plan" => "Pro"}
})
{:ok, %{"success" => true}}