Ogni destinatario mostra se la mail è partita e se è stata aperta, con conteggi in dashboard. Co-authored-by: Cursor <cursoragent@cursor.com>
25 lines
589 B
Ruby
25 lines
589 B
Ruby
module Mailings
|
|
module PublicUrl
|
|
module_function
|
|
|
|
def options
|
|
opts = Rails.application.config.action_mailer.default_url_options.to_h.symbolize_keys
|
|
opts[:protocol] ||= protocol
|
|
port = opts[:port].to_i
|
|
opts.delete(:port) if port.zero? || default_port?(port)
|
|
opts
|
|
end
|
|
|
|
def protocol
|
|
return "https" if Rails.application.config.force_ssl
|
|
return "https" if ENV["ASSUME_SSL"] == "true"
|
|
|
|
"http"
|
|
end
|
|
|
|
def default_port?(port)
|
|
(protocol == "https" && port == 443) || (protocol == "http" && port == 80)
|
|
end
|
|
end
|
|
end
|