-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Description
I was implementing creating or updating a contact in my app, but was being told ext_id had already been taken. On a hunch I switched update_enabled to be camel cased and it worked.
However, According to the docs, this should work as snake cased which conforms to ruby conventions.
class SyncContactWithBrevo
extend Literal::Properties
prop :user_id, Integer, :positional
def self.call(user_id)
new(user_id).call
end
def call
api_client = Brevo::ContactsApi.new
create_contact = Brevo::CreateContact.new(
email: user.email,
ext_id: user.id.to_s,
attributes: {
"FIRSTNAME": user.first_name,
"LASTNAME": user.last_name,
"OPT_IN": user.newsletter_consent.to_s
},
list_ids: [ 12 ],
updateEnabled: true # does not work when `update_enabled`
)
begin
api_client.create_contact(create_contact)
rescue Brevo::ApiError => e
debugger
end
end
private
def user
@user ||= User.find(@user_id)
end
endReactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels