You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: application_mailer.rb
    path of file: ./repos/foreman/app/mailers
    
    the code of the file until where you have to start completion: require 'uri'
require 'shellwords'

class ApplicationMailer < ActionMailer::Base
  include Roadie::Rails::Automatic
  default :delivery_method => proc { Setting[:delivery_method] },
          :from => proc { Setting[:email_reply_address] || "noreply@foreman.example.org" }
  after_action :set_delivery_options

  def self.delivery_settings
    options = {}
    return options unless ['smtp', 'sendmail'].include?(Setting[:delivery_method].to_s)

    prefix = "#{Setting[:delivery_method]}_"

    
  def self.delivery_settings
    options = {}
    return options unless ['smtp', 'sendmail'].include?(Setting[:delivery_method].to_s)

    prefix = "#{Setting[:delivery_method]}_"
    Foreman.settings.category_settings('email').each do |name, setting|
      if name.start_with?(prefix) && setting.value.to_s.present?
        opt_name = name.delete_prefix(prefix)
        options[opt_name] = if name == "sendmail_arguments"
                              Shellwords.shellescape(setting.value)
                            else
                              setting.value
                            end
      end