action-mailer-coder

Configure Rails Action Mailer emails with parameterized mailers and background delivery.

47|11|Updated Nov 26, 2025
One-click install
npx skills add https://github.com/majesticlabs-dev/majestic-marketplace --skill action-mailer-coder
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: action-mailer-coder
Source: https://github.com/majesticlabs-dev/majestic-marketplace/tree/main/plugins/majestic-rails/skills/action-mailer-coder
Command: npx skills add https://github.com/majesticlabs-dev/majestic-marketplace --skill action-mailer-coder

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Designs Rails Action Mailer with parameterized mailers, previews, internationalization, attachments, and background delivery.

Core Features & Use Cases

  • Parameterized mailers with with(params)
  • Background delivery and mail previews
  • Internationalization of emails
  • Attachments and inline assets
  • Tests for mailers

Quick Start

Define a mailer with with(user:, account:) and call deliver_later; preview class to test visuals.

Frequently Asked Questions about action-mailer-coder

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I set up parameterized mailers in Rails?

Parameterized mailers use Rails' with() method to pass variables into mailer actions. Define a mailer class, accept parameters via with(user:, account:), and reference them in your email templates. This approach isolates email logic and makes testing straightforward.

Can I preview emails before sending them in Rails?

Yes. Rails Action Mailer includes a preview system that renders emails in your browser without sending. Create a preview class, define preview methods returning mailer calls, and access them at /rails/mailers to visually test designs, content, and localization.

What's the best way to send emails asynchronously in Rails?

Use deliver_later instead of deliver_now to push email delivery to a background job queue. This keeps your request cycle fast and lets you retry failed sends. Pair it with Active Job and a job backend like Sidekiq or Resque for production reliability.

How do I handle internationalization and attachments in Rails mailers?

Use Rails i18n helpers (I18n.locale, t()) in mailer templates to translate email content. Attach files via the attachments hash, referencing file paths or inline blobs. Combine both to send localized emails with dynamic documents to users worldwide.

Can I test Rails mailers with RSpec?

Yes. RSpec supports mailer specs via have_enqueued_mail and deliver matchers. Assert on recipient, subject, body content, and attachments. Test parameterized calls, background delivery jobs, and preview classes to ensure email logic stays correct across changes.

Do I need Rails 7.1+ to use modern mailer conventions?

Rails 7.1+ introduces refined parameterized mailer syntax, improved preview workflows, and streamlined background delivery conventions. Earlier versions support core features but lack convenience methods and cleaner patterns for grouping mailer logic and inheritance.