add developer newsletters form

This commit is contained in:
Alex Turchyn committed 2023-07-01 13:48:17 +03:00
1 parent 4180d02a1b
commit 3cceaf5cc7
5 files changed
+36 -1

No files matched your search

+19
View File
@@ -0,0 +1,19 @@
# frozen_string_literal: true
class NewslettersController < ApplicationController
def show; end
def update
Faraday.post(Docuseal::NEWSLETTER_URL, newsletter_params.to_json, 'Content-Type' => 'application/json')
rescue StandardError => e
Rails.logger.error(e)
ensure
redirect_to root_path
end
private
def newsletter_params
params.require(:user).permit(:email)
end
end
+1 -1
View File
@@ -30,7 +30,7 @@ class SetupController < ApplicationController
sign_in(@user)
redirect_to root_path
redirect_to newsletter_path
else
render :index, status: :unprocessable_entity
end