Project

mail_hatch

0.0
No commit activity in last 3 years
No release in over 3 years
Ruby gem for Mail Hatch
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies
 Project Readme

📬 Send stunning emails in minutes.

Battle-tested email designs for every need - accessed, configured, and sent through a developer-minded API.

:squirrel: Tested in Production at Jellyswitch

Installation

Add this line to your application's Gemfile:

gem 'mail_hatch'

And run:

bundle install

And restart your web server.

Configuration

Put this into config/initializers/mail_hatch.rb:

Rails.application.config.active_job.custom_serializers << MailHatchSerializer

Usage

Mail Hatch is designed to be a simple replacement for your Rails mailers. First, create a Mail Hatch instance:

mail_hatch = MailHatch.new(
  api_key: <API_KEY>,
  brand_color: "#dfdfdf",
  debug: false,
  dry_run: false,
  sendgrid_api_key: <SENDGRID_KEY>,
  ios_store_url: <IOS STORE URL>,
  google_play_store_url: <GOOGLE PLAY STORE URL>,
  title: "My Application",
  address: "My Address"
)

Then you can invoke any of Mail Hatch's emails. For example, to send a notification email:

mail_hatch.notification(
  to: "foo@bar.com", 
  from: "me@me.com", 
  subject: "You have a new message", 
  text: "<message body>")

Sending in the background with Active Job

  1. Ensure your background job worker process is running jobs from the :default queue.
  2. Prefix your Mail Hatch invocations with async_. For example: async_notification(...).

TODO

  • The async_ prefix needs work
  • Add / link to official docs w/ list of comprehensive options
  • Generator for initializer
  • Previews?
  • LICENSE
  • link to ruby gem in readme