
Security News
ECMAScript 2025 Finalized with Iterator Helpers, Set Methods, RegExp.escape, and More
ECMAScript 2025 introduces Iterator Helpers, Set methods, JSON modules, and more in its latest spec update approved by Ecma in June 2025.
Mailhopper provides a simple ActiveRecord-based queue for asynchronous delivery of email in Rails apps.
Why use Mailhopper to queue your email?
The complete rationale is explained in this blog post: http://www.cerebris.com/blog/2011/09/07/tame-rails-email-dragons-with-mailhopper/
Mailhopper is intended to be used along with a delivery agent such as DelayedMailhopper, which uses DelayedJob to deliver email from the Mailhopper queue. Without a delivery agent, emails will accumulate in the Mailhopper queue but won't be delivered.
DelayedMailhopper can be found here: https://github.com/cerebris/delayed_mailhopper
Rails 3.1+
Add to your project's Gemfile:
gem 'mailhopper'
Install with bundler:
bundle install
Generate default initializer and migration files:
rails generate mailhopper
Before migrating your database, please take a moment to review the CreateEmails
migration that has been generated. In particular, please review the limit to the content
field, which has been set to a safe but very large size (100MB characters). You may wish to change this based upon your needs and particular database.
When you're ready, migrate your database:
rake db:migrate
Don't forget to also install a delivery agent, such as DelayedMailhopper, so that emails will be delivered from your queue !!!
If you want all of your application's email to be queued with Mailhopper, configure mailers either in application.rb or your application's environment-specific configuration files:
MyApp::Application.configure do
config.action_mailer.delivery_method = :mailhopper
end
Alternatively, or additionally, configure individual mailers to use Mailhopper:
class MyMailer < ActionMailer::Base
ActionMailer::Base.delivery_method = :mailhopper
end
The following options can be configured in your initializer (config/initializers/mailhopper):
Mailhopper::Base.setup do |config|
# The base email class used by Mailhopper
config.email_class = Mailhopper::Email
# The base mailer class used by Mailhopper
config.mailer_class = Mailhopper::Mailer
# The method used by the delivery agent to deliver emails from your queue
config.default_delivery_method = :smtp
end
It's preferable to leave these options out of your initializer if the defaults, shown above, are acceptable. Delivery agents may override some defaults (e.g. DelayedMailhopper sets email_class = DelayedMailhopper::Email).
Copyright (c) 2011 Cerebris Corporation. This is free software released under the MIT License (see MIT-LICENSE for details).
FAQs
Unknown package
We found that mailhopper demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
ECMAScript 2025 introduces Iterator Helpers, Set methods, JSON modules, and more in its latest spec update approved by Ecma in June 2025.
Security News
A new Node.js homepage button linking to paid support for EOL versions has sparked a heated discussion among contributors and the wider community.
Research
North Korean threat actors linked to the Contagious Interview campaign return with 35 new malicious npm packages using a stealthy multi-stage malware loader.