Try fixing query_api 0 argument error

This commit is contained in:
Ziyi 2021-04-01 22:01:09 -07:00 committed by CactusPuppy
parent 83d89fc361
commit c00180019b
No known key found for this signature in database
GPG key ID: 4B33B0A3E15E2C82

View file

@ -13,11 +13,11 @@ class MailblusterManager
options = @@auth_headers.merge({ options = @@auth_headers.merge({
body: body.to_json body: body.to_json
}) })
method(path, options).parsed_response send(method, path, options).parsed_response
end end
def self.create_lead(user) def self.create_lead(user)
query_api(post, '/', { query_api(:post, '/', {
'email' => user.email, 'email' => user.email,
'firstName' => user.name, 'firstName' => user.name,
'overrideExisting' => true, 'overrideExisting' => true,
@ -28,7 +28,7 @@ class MailblusterManager
def self.edit_lead(user, add_tags: [], remove_tags: [], old_email: nil) def self.edit_lead(user, add_tags: [], remove_tags: [], old_email: nil)
email_hash = Digest::MD5.hexdigest(old_email.presence || user.email) email_hash = Digest::MD5.hexdigest(old_email.presence || user.email)
query_api(put, "/#{email_hash}", { query_api(:put, "/#{email_hash}", {
'email' => user.email, 'email' => user.email,
'firstName' => user.name, 'firstName' => user.name,
'addTags' => add_tags, 'addTags' => add_tags,
@ -38,6 +38,6 @@ class MailblusterManager
def self.delete_lead(user) def self.delete_lead(user)
email_hash = Digest::MD5.hexdigest user.email email_hash = Digest::MD5.hexdigest user.email
query_api(delete, "/#{email_hash}", {}) query_api(:delete, "/#{email_hash}", {})
end end
end end