active_admin_mail

Manage the emails you send and your ActionMailer mailers with ActiveAdmin

Installation

Usage

class UserMailer < ActionMailer::Base

  def new_partnership(user)
    @user = user
    active_admin_mail(to: @user.email)
  end

end

active_admin_mail internally...

  • Looks up the mail template in the database via find_by(:klass => 'UserMailer', :action => 'new_partnership')
  • Parses that mail template into liquid to render
  • Parses the instance variables in the action that don't start with @_ to a mapped liquid hash like { 'user' => { 'id' => 1 }
  • Sends the email using ActionMailer#mail
  • Logs the email

Todo

  • Mail layouts
  • Filters for active_admin
  • txt and html
  • Wysiwyg?
  • Preview?
  • Fallback?
  • CC, BCC per mailer?
  • callbacks?