Open Source Ruby API For Build Email Automation Apps
Free Email Automation Ruby Library That Simplifies Email Automation Apps Creation & Sending Emails via Templates. Create, Manage, and Track Various Types of Email Sequences in Ruby Applications.
What is MailyHerald ?
MailyHerald is a powerful, open-source Ruby on Rails gem designed to streamline email communication within Ruby applications. Functioning as a self-hosted alternative to services like Mailchimp, MailyHerald offers developers’ robust tools for managing various types of email campaigns, including transactional emails, newsletters, and onboarding sequences. The library supports various mailing types such as Ad-hoc mailings, one-time mailings, periodical mailings and mailing sequences. MailyHerald integrates with Liquid templating, enabling dynamic content in emails. This allows for personalized messages using user attributes. By promoting organized templates, decoupled logic, and centralized configuration, it empowers developers to build more maintainable, scalable, and robust communication features.
MailyHerald is very easy to handle and empowers developers to create sophisticated email automation systems directly within their Ruby on Rails applications. For software developers looking to build their own email automation tools, marketing platforms, or customer engagement systems, MailyHerald provides the perfect foundation. Email deliveries are handled asynchronously using Sidekiq, ensuring non-blocking operations and efficient processing. Its flexibility, combined with powerful features like background processing and dynamic templating, makes it an excellent choice for developers seeking a self-hosted email management system.
Getting Started with MailyHerald
The easiest way to install the MailyHerald library is via RubyGems. Please use the following command for easy installation.
Install MailyHerald via Rubygems
gem install maily_herald
Creating Email Sequences via Ruby
The open source MailyHerald library provides software developers the capability to build complex email sequences with precise timing inside Ruby applications. A series of emails sent in a defined order with specific delays, ideal for onboarding processes. Moreover, it offers a streamlined and developer-friendly approach to managing email notifications in Ruby applications. The following example demonstrates, how to create complex email sequences using Ruby commands.
How to Create Complex Email Sequences inside Ruby Apps?
MailyHerald.sequence(:onboarding) do |sequence|
sequence.title = "User Onboarding Sequence"
sequence.list = :all_users
sequence.start_at = "user.created_at"
# Welcome email (immediately)
sequence.add_emails do |email|
email.title = "Welcome Email"
email.subject = "Welcome to Our App!"
email.absolute_delay = 0.hours
email.template = "Hi {{user.name}}, thanks for joining us!"
end
# Follow-up (3 days later)
sequence.add_emails do |email|
email.title = "Getting Started Guide"
email.subject = "Here's how to get the most from our app"
email.absolute_delay = 3.days
end
end
Create Event-based Triggers via Ruby
Emails can be triggered by application events, making it perfect for user onboarding or activity-based messaging. The open source MailyHerald library has provided complete support for creating and managing event-based email triggers inside Ruby applications. Here is a simple example that demonstrates how software developers can define an event-triggered sequence using Ruby commands.
How to Define an Event-Triggered Sequence inside Ruby Apps?
MailyHerald.sequence(:abandoned_cart) do |sequence|
sequence.title = "Abandoned Cart Reminders"
sequence.list = :shopping_users
sequence.trigger = :cart_updated
sequence.add_emails do |email|
email.title = "1 Hour Reminder"
email.subject = "Your cart is waiting!"
email.absolute_delay = 1.hour
email.conditions = "{{user.cart.items.count}} > 0"
end
end
Dynamic Email Templates Handling via Ruby
One of the standout features of open source MailyHerald library is its powerful templating system. Developers can define email templates with placeholders for dynamic content. This means you can create a single template for a specific type of notification and then populate it with user-specific details like names, order numbers, and purchased items at runtime. This significantly reduces redundancy and makes template updates much easier. Here is a simple example that shows how to use Liquid Templates to send email inside Ruby applications.
How to Send Email using Liquid Templates via Ruby Library?
config.ad_hoc_mailing :welcome do |mailing|
mailing.list = :newsletters
mailing.subject = "Welcome, {{user.name}}!"
mailing.template = "We're glad to have you on board."
mailing.enable
end
Flexibility and Extensibility
While the MailyHerald library provides a solid foundation, it's also designed to be extensible. Developers can integrate it with various email delivery services (like SendGrid, Mailgun, or even standard SMTP) and customize its behavior to fit specific project requirements.