Sha256: 88fc3d89c256cb7a2b560c295304421e89016b5ed1970414855ad2d973948849

Contents?: true

Size: 640 Bytes

Versions: 8

Compression:

Stored size: 640 Bytes

Contents

ActiveSupport.on_load(:action_mailer, {yield: true}) do |action_mailer|
  action_mailer.class_eval do # To support Rails less than 6
    # sit in the middle and compile the html
    def bootstrap_mail(*args, &block)
      mail_message = mail(*args, &block)
      # if you override the #mail method in you ApplicationMailer you may intentionally return something other than a mail message
      if mail_message
        bootstrap = BootstrapEmail::Compiler.new(mail_message, type: :rails)
        bootstrap.perform_full_compile
      end
    end
    alias bootstrap_email bootstrap_mail
    alias make_bootstrap_mail bootstrap_mail
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
bootstrap-email-1.1.0 lib/bootstrap-email/rails/action_mailer.rb
bootstrap-email-1.0.2 lib/bootstrap-email/rails/action_mailer.rb
bootstrap-email-1.0.1 lib/bootstrap-email/rails/action_mailer.rb
bootstrap-email-1.0.0 lib/bootstrap-email/rails/action_mailer.rb
bootstrap-email-1.0.0.alpha4 lib/bootstrap-email/rails/action_mailer.rb
bootstrap-email-1.0.0.alpha3.1 lib/bootstrap-email/rails/action_mailer.rb
bootstrap-email-1.0.0.alpha3 lib/bootstrap-email/rails/action_mailer.rb
bootstrap-email-1.0.0.alpha2.1 lib/bootstrap-email/rails/action_mailer.rb