VisitWidgetMailer

Short description and motivation.

Usage

How to use my plugin.

Installation

Add this line to your application's Gemfile:

gem 'visit_widget_email'

And then execute:

$ bundle

Or install it yourself as:

$ gem install visit_widget_email

Usage

Command and Query

VisitWidgetEmail::Commands::SendEmail is the command used to send emails anywhere in the app. The constructor takes these params:

mailer_class_name, mailer_action, client_id, params

Where params are the custom parameters for that particular mailer.

For the command to work, you'll need to implement the VisitWidgetEmail::Queries::GetEmailParamsFromClient class. This query should have an execute method that takes in the client id and returns a VisitWidgetEmail::EmailParams object with these attributes set:

  • primary_color
  • host
  • logo_url
  • client_name
  • enable_email_links
  • ios_itunes_app_id
  • android_bundle_identifier

Mailers

You'll want to have your ApplicationMailer inherit from VisitWidgetEmail::Mailer:

class ApplicationMailer < VisitWidgetEmail::Mailer
end

Your mailer methods should have email_params as the first parameter.

Contributing

Contribution directions go here.

License

The gem is available as open source under the terms of the MIT License.