Proca.Service.Detail (proca v3.4.1)

Implement supporter detail lookup.

Will use a webhook service to do a POST passing:

{
  email, contactRef
}

returns subset of Action Message V2. Currently:

  • privacy
    • optIn
    • emailStatus
    • emailStatusChanged
  • action
    • customFields
{
  privacy: {
    optIn: true/false
    emailStatus: "doubleOptIn"
  }
}

Link to this section Summary

Link to this section Functions

Link to this function

changeset(params)

Link to this function

changeset(ch, params)

Specs

changeset(
  %Proca.Service.Detail{action: term(), id: term(), privacy: term()}
  | Ecto.Changeset.t(%Proca.Service.Detail{
      action: term(),
      id: term(),
      privacy: term()
    }),
  map()
) ::
  Ecto.Changeset.t(%Proca.Service.Detail{
    action: term(),
    id: term(),
    privacy: term()
  })
Link to this function

lookup(org, supporter)

Specs

lookup(Proca.Org, Proca.Supporter) ::
  {:ok, Proca.Service.Detail} | {:error, any()}
Link to this function

update(supporter, action, details)

Specs

update(
  Ecto.Changeset.t(%Proca.Supporter{
    __meta__: term(),
    action_page: term(),
    action_page_id: term(),
    actions: term(),
    address: term(),
    area: term(),
    campaign: term(),
    campaign_id: term(),
    contacts: term(),
    dupe_rank: term(),
    email: term(),
    email_status: term(),
    email_status_changed: term(),
    fingerprint: term(),
    first_name: term(),
    id: term(),
    inserted_at: term(),
    last_name: term(),
    processing_status: term(),
    source: term(),
    source_id: term(),
    updated_at: term()
  }),
  Ecto.Changeset.t(%Proca.Service.Detail.Action{
    custom_fields: term(),
    id: term()
  }),
  %Proca.Service.Detail{action: term(), id: term(), privacy: term()}
) ::
  {Ecto.Changeset.t(%Proca.Supporter{
     __meta__: term(),
     action_page: term(),
     action_page_id: term(),
     actions: term(),
     address: term(),
     area: term(),
     campaign: term(),
     campaign_id: term(),
     contacts: term(),
     dupe_rank: term(),
     email: term(),
     email_status: term(),
     email_status_changed: term(),
     fingerprint: term(),
     first_name: term(),
     id: term(),
     inserted_at: term(),
     last_name: term(),
     processing_status: term(),
     source: term(),
     source_id: term(),
     updated_at: term()
   }),
   Ecto.Changeset.t(%Proca.Service.Detail.Action{
     custom_fields: term(),
     id: term()
   })}
Link to this function

update_custom_fields(ch, arg2)

Link to this function

update_email_status(ch, arg2)

Link to this function

update_opt_in(ch, arg2, org)