lib/mail_engine/engine.rb in mail_engine-0.1.6 vs lib/mail_engine/engine.rb in mail_engine-0.1.7
- old
+ new
@@ -19,11 +19,13 @@
ActionView::Template.register_template_handler(:liquid, LiquidView)
end
initializer "mail_engine.register_database_template" do
ActionMailer::Base.layout "layouts/mail_engine/mail_template_layouts/none"
- ActionMailer::Base.send(:prepend_view_path, MailEngine::MailTemplateResolver.instance)
+ ActionMailer::Base.prepend_view_path(MailEngine::MailTemplateResolver.instance)
+ # used when mail_template preview.
+ MailEngine::ApplicationController.prepend_view_path(MailEngine::MailTemplateResolver.instance)
end
initializer "mail_engine.add_acts_as_mail_receiver" do
ActiveRecord::Base.send(:include, MailEngine::ActsAsMailReceiver)
end
@@ -46,15 +48,9 @@
# don't process config file if not fine it.
if MailEngine::Base.current_config.present?
raise "Please add :user_class_name config into mail_engine_config.yml." if MailEngine::Base.current_config["user_class_name"].blank?
MailEngine::USER_MODEL = MailEngine::Base.current_config["user_class_name"].constantize unless defined?(MailEngine::USER_MODEL)
-
- # in development mode all mails send to replacement_email_in_dev_mode
- if defined?(::MailSafe::Config) and replacement_email = MailEngine::Base.current_config["replacement_email"]
- ::MailSafe::Config.internal_address_definition = /#{replacement_email}/
- ::MailSafe::Config.replacement_address = replacement_email
- end
else
puts "\e[1;31;40m[Mail Engine Warning]\e[0m Not found mail_engine_config.yml, so mail_engine won't be able to work."
end
end
end
\ No newline at end of file