The Kit (ConvertKit) integration component adds a Kit (ConvertKit) integration to your Rails app. It's built using Kit's v4 API.
It includes a newsletter signup form, along with a utility Service Class you can use anytime you need to add a Kit subscription ability to any feature in your app.
It also comes with Spam Bot protection powered by Cloudflare Turnstile. The Cloudflare Turnstile implementation uses the railscloudflareturnstile gem.
You can install the Kit (ConvertKit) integration component by running the following command:
rails g instrumental:kit
Follow the instructions in the Cloudflare Turnstile documentation to configure Cloudflare Turnstile.
The Kit Component comes with a newsletter signup form page and controller which you can use (or refer to) anytime you need to add a Kit subscription ability to any feature in your app.
The newsletter signup form page is implemented on the route /newsletter/subscribe
.
Note: Your kit_controller.rb
has allow_unauthenticated_access
which makes your newsletter signup form available to the public. If you want it to be available only to logged-in users, then remove allow_unauthenticated_access
(assuming you’re using Rails authentication, which is what Instrumental Authentication Component is built on).
The Kit (ConvertKit) integration component installs kit_service.rb
along with a Service Class you can use anytime you need to add a Kit subscription ability to any feature in your app.
It provides the following functionality:
For details on how this functionality works, refer to the code and comments located in kit_service.rb
.
I created Instrumental Components to make designing and building professional apps with Ruby on Rails easy, fast, and fun. I use it on all of my projects and I hope it helps you build something great.