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
Specs
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
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"
})
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()
Specs
get_all_registrants_in_webinar(Goto.Token.t()) :: [Webinar.t()]