From 803c98b158b8272dfcb9fde33e2a8dbc0b272124 Mon Sep 17 00:00:00 2001 From: CactusPuppy Date: Wed, 17 Mar 2021 15:20:01 -0700 Subject: [PATCH] Ensure Mailbluster helper methods actually correctly cause changes in the end service --- app/helpers/external/mailbluster_helper.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/helpers/external/mailbluster_helper.rb b/app/helpers/external/mailbluster_helper.rb index d00f7afa..984c76f5 100644 --- a/app/helpers/external/mailbluster_helper.rb +++ b/app/helpers/external/mailbluster_helper.rb @@ -11,8 +11,10 @@ module External def create_lead(user) uri = URI(MAILBLUSTER_URL) http = Net::HTTP.new(uri.host, uri.port) + http.use_ssl = true request = Net::HTTP::Post.new(uri.path, 'Authorization' => ENV['MAILBLUSTER_API_KEY']) + request['Content-Type'] = 'application/json' request.body = { 'email' => user.email, 'firstName' => user.name, @@ -31,8 +33,10 @@ module External email_hash = Digest::MD5.hexdigest user.email uri = URI(MAILBLUSTER_URL + email_hash) http = Net::HTTP.new(uri.host, uri.port) + http.use_ssl = true request = Net::HTTP::Delete.new(uri.path, 'Authorization' => ENV['MAILBLUSTER_API_KEY']) + request['Content-Type'] = 'application/json' response = http.request(request) response.body rescue StandardError => e