mirror of https://github.com/docusealco/docuseal
parent
4180d02a1b
commit
3cceaf5cc7
@ -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
|
||||
@ -0,0 +1,14 @@
|
||||
<div class="max-w-xl mx-auto px-2">
|
||||
<h1 class="text-4xl font-bold text-center my-8">👨💻 Developer Newsletters</h1>
|
||||
<%= form_for current_user, url: newsletter_path do |f| %>
|
||||
<div class="form-control">
|
||||
<%= f.email_field :email, placeholder: 'Email', required: true, class: 'base-input' %>
|
||||
</div>
|
||||
<div class="form-control mt-4">
|
||||
<%= f.button button_title, class: 'base-button' %>
|
||||
</div>
|
||||
<div class="text-center mt-2">
|
||||
<a href="/" class="link">Skip</a>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
Loading…
Reference in new issue