Goto.Registrant (Peacemaker v3.3.5-rc.7) View Source

This module interfaces with Goto's API at a high level.

From an overview, we use Goto.Registrant to perform common operations to GotoWebinar, such enrolling a customer into a webinar or removing them.

The data pipeline is as follows:

[Goto.Registrant] -> [Goto.Token] -> [Goto.API.Registrants]

Link to this section Summary

Functions

Changes the email for every GotoWebinar the customer is enrolled in

Creates a Registrant and enrolls them into a GotoWebinar

Deletes a registrant from a GotoWebinar

Find all webinars the registrant is enrolled in

Link to this section Types

Link to this type

create_registrant_request()

View Source

Specs

create_registrant_request() :: %{
  subject: String.t(),
  first_name: String.t(),
  last_name: String.t(),
  email: String.t()
}
Link to this type

delete_registrant_request()

View Source

Specs

delete_registrant_request() :: %{
  subject: String.t(),
  first_name: String.t(),
  last_name: String.t(),
  email: String.t(),
  registrant_key: pos_integer()
}

Specs

registrant_response() :: %{
  asset: bool(),
  joinUrl: String.t(),
  registrantKey: pos_integer(),
  status: String.t()
}

Link to this section Functions

Specs

change_email(%{current_email: String.t(), new_email: String.t()}) :: [
  {atom(), map()}
]

Changes the email for every GotoWebinar the customer is enrolled in

NOTE: Calling this method WILL resend GotoWebinar emails to the new address. Goto currently does not supply a way to prevent emails from being sent out dynamically.

Example Usage:

  Goto.Registrant.change_email(%{
    current_email: "kawika@wealthfit.com",
    new_email: "kawika+new@wealthfit.com"
  })

Specs

create_registrant(create_registrant_request()) ::
  {atom(), registrant_response()}

Creates a Registrant and enrolls them into a GotoWebinar

Example Usage:

  Goto.Registrant.create_registrant(%{
    subject: "30-Day Real Estate Investor Startup Intensive",
    first_name: "Bob",
    last_name: "Saget",
    email: "bob@saget.com"
  })

Specs

delete_registrant(delete_registrant_request()) ::
  {atom(), registrant_response()}

Deletes a registrant from a GotoWebinar

Example Usage:

  Goto.Registrant.delete_registrant(%{
    subject: "30-Day Real Estate Investor Startup Intensive",
    registrant_key: 4194120923,
    first_name: "Bob",
    last_name: "Saget",
    email: "bob@saget.com"
  })
Link to this function

find_all_enrolled_webinars_for_registrant(token)

View Source

Specs

find_all_enrolled_webinars_for_registrant(Goto.Token.t()) :: [
  {map(), Peacemaker.Goto.Webinar.t()}
]

Find all webinars the registrant is enrolled in

Example Usage:

  account = Peacemaker.Accounts.find_one(email: "kawika@wealthfit.com")
  Goto.Token.build
  |> Goto.Token.set_registrant(account)
  |> Goto.Token.set_wealthfit_credentials()
  |> Goto.Registrant.find_all_enrolled_webinars_for_registrant()
Link to this function

get_all_registrants_in_webinar(token)

View Source

Specs

get_all_registrants_in_webinar(Goto.Token.t()) :: [Webinar.t()]
Link to this function

get_join_url(webinar_key, email)

View Source