Zum Hauptinhalt springen
tsecurity.de LIVE
Echtzeit-Radar & Feeds
Alle RSS Feeds
👥 Community & Social
YouTube Security VideosMicrosoft Developer: Skill up on Copilot Studio Oct 8th!(24.09.2026 um 01:01 Uhr)
Sichere Programmierung🦄 Sharing DEV Followers Count on Github Profile 🦄(24.09.2026 um 00:42 Uhr)
Sichere ProgrammierungHow I Would Build a Private AI Coding Workstation in 2026(24.09.2026 um 00:46 Uhr)
Sichere ProgrammierungBuilding a TWAP Distance-Based Polymarket Trading Strategy(24.09.2026 um 00:50 Uhr)
Sichere ProgrammierungMy factual-recall tasks were scoring format, not facts(24.09.2026 um 01:15 Uhr)
YouTube Security VideosMicrosoft Developer: Skill up on Copilot Studio Oct 8th!(24.09.2026 um 01:01 Uhr)
Sichere Programmierung🦄 Sharing DEV Followers Count on Github Profile 🦄(24.09.2026 um 00:42 Uhr)
Sichere ProgrammierungHow I Would Build a Private AI Coding Workstation in 2026(24.09.2026 um 00:46 Uhr)
Sichere ProgrammierungBuilding a TWAP Distance-Based Polymarket Trading Strategy(24.09.2026 um 00:50 Uhr)
Sichere ProgrammierungMy factual-recall tasks were scoring format, not facts(24.09.2026 um 01:15 Uhr)
Intelligence View
⚡ tsecurity.de Intelligence

Add newsletter subscriptions to Rails 8 signups

Users are creating accounts on your new Saas. Yay (and not just family and friends or bots). Yay! Now comes the next step from every marketing handbook: capturing newsletter subscriptions. This article builds on Add Sign Up to Rails 8’ A…

0
↗ Quelle (dev.to)
Reagiere als Erste:r — dein Feedback zählt!

Users are creating accounts on your new Saas. Yay (and not just family and friends or bots). Yay! Now comes the next step from every marketing handbook: capturing newsletter subscriptions.



This article builds on Add Sign Up to Rails 8’ Authentication.



Add a simple checkbox to let users opt in to product updates during signup. Store their preference using Rails Vault and manage the subscription with Rails Courrier.



First, add Rails Vault and Rails Courrier to your Gemfile:




gem "rails_vault"
gem "rails_courrier"







Rails Vault adds simple and easy settings, preferences and so on to any ActiveRecord model (I recently pushed 1.0.0). Courrier is API-powered email delivery for Ruby apps with support for Mailgun, Postmark, Resend and more. Rails Courrier is the Rails “wrapper” for Courrier. These two gems work really nicely together for this feature.



Run bundle install and generate the Rails Vault migration:




rails generate rails_vault:install
rails db:migrate







It creates a new file app/models/user/subscriptions.rb:




class User::Subscriptions < Vault
vault_attribute :product_emails_subscribed_at, :datetime

# Add more subscription types as needed:
# vault_attribute :marketing_emails_subscribed_at, :datetime
# vault_attribute :weekly_digest_subscribed_at, :datetime
end







And updates your User model to use this vault:




# app/models/user.rb
class User < ApplicationRecord
+ vault :subscriptions

has_secure_password
has_many :sessions, dependent: :destroy
end







This keeps subscription data organized without cluttering your User table. More subscription types can be added later without database migrations.



Now the plumbing is done, add a checkbox to your signup form in app/views/signups/new.html.erb:




<%= form.check_box :product_emails %>
<%= form.label :product_emails, "Subscribe to product updates" %>







Update the Signup model to accept this parameter:




# app/models/signup.rb
class Signup
include ActiveModel::Model
include ActiveModel::Attributes

attribute :email_address, :string
attribute :password, :string
attribute :terms, :boolean, default: false
+ attribute :product_emails, :boolean, default: false

# …existing validations

def save
if valid?
User.create!(email_address: email_address, password: password).tap do |user|
create_workspace_for user
+ subscribe_to_product_emails user

send_welcome_email_to user
end
end
end

private

+ def subscribe_to_product_emails(user)
+ return if product_emails
+
+ user.create_subscriptions(product_emails_subscribed_at: Time.current)
+
+ Courrier::Subscriber.create email_address
+ end
end


def signup_params
# NOTE: new syntax, see PR: https://github.com/rails/rails/pull/51674
- params.expect(signup: [:email_address, :password, :terms])
+ params.expect(signup: [:email_address, :password, :terms, :product_emails])
end







Create config/initializers/courrier.rb:




Courrier.configure do |config|
# …

config.subscriber = {
provider: "buttondown",
api_key: Rails.application.credentials.dig(:buttondown, :api_key)
}
end







Replace "buttondown" with your preferred newsletter provider. Courrier has support for many providers.



Time to test it! Create a new user through the signup form with the product emails checkbox enabled. The subscription gets stored in the Rails Vault and the subscriber gets created in your newsletter service.



All code from this article is available in the Rails 8 Authentication repository.



Questions about subscriptions or newsletter management? Let me know below in the comments.

IR-PLAYBOOK-VULN-REMEDIATION
MEDIUM
SOC Incident Playbook: Vulnerability Remediation & Verification
1-Click Detection Engineering: Sigma & YARA Rules
SOC Ready
title: Detect Exploitation - Add newsletter subscriptions to Rails 8 signups
id: 7c1a9959-9cc7-4db6-a25e-e30f4461b7bd
status: experimental
description: Automatisch generierte SIEM-Erkennungsregel basierend auf CTI Intelligence
references:
  - https://tsecurity.de/
author: iShareStuff CTI Automated Detection Engine
date: 2026-09-24
logsource:
  category: network_connection
  product: any
detection:
  selection:
      CommandLine|contains:
        - 'exploit'
  condition: selection
falsepositives:
  - Legitime administrative Zugriffe oder Penetrationstests
level: high
tags:
  - attack.initial_access
rule CTI_Threat_Indicator {
    meta:
        author = "iShareStuff CTI Automated Detection Engine"
        date = "2026-09-24"
        description = "YARA Signature for "
    strings:
        $str = "Add newsletter subscriptions t" ascii wide
    condition:
        any of them
}
Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten Add newsletter subscriptions to Rails 8 signups

Thematisch verwandte Begriffe: newsletter, subscriptions, Rails, signups · 6 Treffer

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Zum Aktualisieren ziehen
ZERO-DAY CVE-2026-96550 | A vulnerability was found in sfturing hosp_order up to 627f426331da8086c…
Advisory →
TTS Reader • tsecurity.de Voice
tsecurity.de Icon
tsecurity.de App
Offline-Lesen, Eilmeldungen & 0ms Ladezeit

Installiere tsecurity.de direkt auf deinen Home-Bildschirm für das ultimative Vollbild-Magazinerlebnis ohne Browser-Leisten.

Nächster Beitrag
Themen-Radar & Intelligence Matrix
Echtzeit-Taxonomie nach Angriffsvektoren & Plattformen

tsecurity.de Live Threat Radar

🔴 LIVE RADAR
MONITORING
AKTIV
CVE-DATENBANK
LIVE
🔍
Community Radar & Live Chat
Sentinel Bot online • Live-Stream
Dein Cluster: Security Explorer
Match:
lädt…
Verbindung zum Community-Stream wird aufgebaut...
Bearbeitungsmodus — Senden überschreibt deine Nachricht
Community-Puls — was gerade passiert
lädt…
Aktivitäten deiner Analysten
lädt…
Neues Thema oder Eilmeldung einreichen

Reiche interessante Links, Zero-Days oder Debatten ein. Die Community entscheidet per Upvote über die Veröffentlichung.

Heiß diskutierte Einreichungen
🔖 Gespeicherte Artikel
📂 Keine gespeicherten Artikel vorhanden.
Zurück Ziehen Vor
Links: vorheriger Artikel Rechts: nächster Artikel unten: schließen
News NIS-2 Frühwarnung Tier-1 Intel TTP ⏱️ 3 Min vor 10 Min
Artikeldaten werden geladen...

Zurück: vorheriger Vor: nächster
↗ Original-Quelle
Social Reaktionen Deine Reaktion zählt
Einstufung & Relevanz-Poll 0 Stimmen
In sozialen Netzwerken teilen 1-Klick