Glific v0.3.1 Glific.Flows.ContactSetting View Source
Since many of the functions set/update fields in contact and related tables, lets centralize all the code here for now
Link to this section Summary
Functions
Add a preference to a contact. For now, all preferences are stored under the settings map, with a sub-map of preferences. We expect to get more clarity on this soon
Delete a preference from a contact. We actually dont really delete it, we just set the value to false, and hence turn it off
Get all the preferences for this contact
Reset the preferences for a contact.
Set the language for a contact
Set the name for a contact
Wrapper function for setting the contact preference, if preference is empty, it indicates to reset the preference
Link to this section Functions
Specs
add_contact_preference(Glific.Flows.FlowContext.t(), String.t(), boolean()) :: Glific.Flows.FlowContext.t()
Add a preference to a contact. For now, all preferences are stored under the settings map, with a sub-map of preferences. We expect to get more clarity on this soon
Specs
delete_contact_preference(Glific.Flows.FlowContext.t(), String.t()) :: Glific.Flows.FlowContext.t()
Delete a preference from a contact. We actually dont really delete it, we just set the value to false, and hence turn it off
Specs
get_contact_preferences(Glific.Flows.FlowContext.t()) :: [String.t()]
Get all the preferences for this contact
Specs
reset_contact_preference(Glific.Flows.FlowContext.t()) :: Glific.Flows.FlowContext.t()
Reset the preferences for a contact.
Specs
set_contact_language(Glific.Flows.FlowContext.t(), String.t()) :: Glific.Flows.FlowContext.t()
Set the language for a contact
Specs
set_contact_name(Glific.Flows.FlowContext.t(), String.t()) :: Glific.Flows.FlowContext.t()
Set the name for a contact
Specs
set_contact_preference(Glific.Flows.FlowContext.t(), String.t() | nil) :: Glific.Flows.FlowContext.t()
Wrapper function for setting the contact preference, if preference is empty, it indicates to reset the preference