Class: Lesli::ApplicationLesliMailer

Inherits:
ActionMailer::Base
  • Object
show all
Defined in:
app/mailers/lesli/application_lesli_mailer.rb

Direct Known Subclasses

DeviseMailer

Instance Method Summary collapse

Constructor Details

#initializeApplicationLesliMailer

after_action :log_mail_requests



41
42
43
44
45
46
47
48
# File 'app/mailers/lesli/application_lesli_mailer.rb', line 41

def initialize

    super

    @app = {}
    @custom = {}
    @params = {}
end

Instance Method Details

#build_url(path, params = {}) ⇒ Object



50
51
52
53
54
55
56
57
58
59
60
61
62
# File 'app/mailers/lesli/application_lesli_mailer.rb', line 50

def build_url(path, params = {})
    default_url = Rails.application.config.action_mailer.default_url_options
    host = default_url[:host].to_s.sub(/\Ahttps?:\/\//, "")
    scheme = default_url[:protocol]&.delete(":") || "http"

    URI::Generic.build(
        scheme: scheme,
        host: host,
        port: default_url[:port],
        path: path,
        query: params.to_query.presence
    ).to_s
end