2017-07-23 15:17:16 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2004-11-24 01:04:44 +00:00
|
|
|
#--
|
2023-02-23 10:38:16 +00:00
|
|
|
# Copyright (c) David Heinemeier Hansson
|
2004-11-24 01:04:44 +00:00
|
|
|
#
|
|
|
|
# Permission is hereby granted, free of charge, to any person obtaining
|
|
|
|
# a copy of this software and associated documentation files (the
|
|
|
|
# "Software"), to deal in the Software without restriction, including
|
|
|
|
# without limitation the rights to use, copy, modify, merge, publish,
|
|
|
|
# distribute, sublicense, and/or sell copies of the Software, and to
|
|
|
|
# permit persons to whom the Software is furnished to do so, subject to
|
|
|
|
# the following conditions:
|
|
|
|
#
|
|
|
|
# The above copyright notice and this permission notice shall be
|
|
|
|
# included in all copies or substantial portions of the Software.
|
|
|
|
#
|
|
|
|
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
|
|
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
|
|
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
|
|
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
|
|
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
|
|
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
|
|
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
|
|
#++
|
|
|
|
|
2016-08-06 17:01:31 +00:00
|
|
|
require "abstract_controller"
|
2017-10-21 13:22:17 +00:00
|
|
|
require "action_mailer/version"
|
2022-10-28 16:00:24 +00:00
|
|
|
require "action_mailer/deprecator"
|
2008-11-25 06:41:24 +00:00
|
|
|
|
2010-05-02 11:48:46 +00:00
|
|
|
# Common Active Support usage in Action Mailer
|
2017-04-22 17:45:51 +00:00
|
|
|
require "active_support"
|
2016-08-06 17:01:31 +00:00
|
|
|
require "active_support/rails"
|
|
|
|
require "active_support/core_ext/class"
|
|
|
|
require "active_support/core_ext/module/attr_internal"
|
|
|
|
require "active_support/core_ext/string/inflections"
|
|
|
|
require "active_support/lazy_load_hooks"
|
2010-01-29 15:16:01 +00:00
|
|
|
|
2024-01-18 09:29:42 +00:00
|
|
|
# :include: ../README.rdoc
|
2008-11-23 18:27:25 +00:00
|
|
|
module ActionMailer
|
2009-12-03 04:01:01 +00:00
|
|
|
extend ::ActiveSupport::Autoload
|
|
|
|
|
2012-08-01 18:54:22 +00:00
|
|
|
eager_autoload do
|
|
|
|
autoload :Collector
|
|
|
|
end
|
|
|
|
|
2009-12-03 04:01:01 +00:00
|
|
|
autoload :Base
|
2023-03-10 04:35:18 +00:00
|
|
|
autoload :Callbacks
|
2010-01-19 14:34:58 +00:00
|
|
|
autoload :DeliveryMethods
|
2015-05-04 18:46:51 +00:00
|
|
|
autoload :InlinePreviewInterceptor
|
2009-12-17 01:23:08 +00:00
|
|
|
autoload :MailHelper
|
2017-01-28 10:20:46 +00:00
|
|
|
autoload :Parameterized
|
2013-12-16 05:52:58 +00:00
|
|
|
autoload :Preview
|
2016-08-06 17:01:31 +00:00
|
|
|
autoload :Previews, "action_mailer/preview"
|
2009-12-27 11:09:20 +00:00
|
|
|
autoload :TestCase
|
2009-12-03 04:01:01 +00:00
|
|
|
autoload :TestHelper
|
2014-08-13 21:50:38 +00:00
|
|
|
autoload :MessageDelivery
|
2018-11-30 22:33:35 +00:00
|
|
|
autoload :MailDeliveryJob
|
2023-02-09 22:14:52 +00:00
|
|
|
autoload :QueuedDelivery
|
2023-06-21 08:16:50 +00:00
|
|
|
autoload :FormBuilder
|
2018-05-23 20:50:36 +00:00
|
|
|
|
|
|
|
def self.eager_load!
|
|
|
|
super
|
|
|
|
|
|
|
|
require "mail"
|
|
|
|
Mail.eager_autoload!
|
2022-03-01 15:08:46 +00:00
|
|
|
|
|
|
|
Base.descendants.each do |mailer|
|
|
|
|
mailer.eager_load! unless mailer.abstract?
|
|
|
|
end
|
2018-05-23 20:50:36 +00:00
|
|
|
end
|
2008-11-23 18:27:25 +00:00
|
|
|
end
|
2015-09-09 12:44:12 +00:00
|
|
|
|
2016-08-06 17:01:31 +00:00
|
|
|
autoload :Mime, "action_dispatch/http/mime_type"
|
2015-09-09 12:44:12 +00:00
|
|
|
|
|
|
|
ActiveSupport.on_load(:action_view) do
|
|
|
|
ActionView::Base.default_formats ||= Mime::SET.symbols
|
2023-05-08 01:10:27 +00:00
|
|
|
ActionView::Template.mime_types_implementation = Mime
|
2020-05-21 01:38:00 +00:00
|
|
|
ActionView::LookupContext::DetailsKey.clear
|
2015-09-09 12:44:12 +00:00
|
|
|
end
|