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