Skip to content

Instantly share code, notes, and snippets.

@pcasaretto
Last active February 18, 2019 17:42
Show Gist options
  • Save pcasaretto/81633d12ad7eb70b9575ed0f2c217de6 to your computer and use it in GitHub Desktop.
Save pcasaretto/81633d12ad7eb70b9575ed0f2c217de6 to your computer and use it in GitHub Desktop.
class BaseUserMailer
def initialize(smtp_settings)
@client = MailSendingLibrary.new(smtp_settings)
end
def send_mail(user, mail)
@client.send_mail(user.email, mail.body)
end
end
class TransactionalMailer < BaseUserMailer
SMTP_SETTINGS = ...
def initialize()
super(SMTP_SETTINGS)
end
end
class MarketingMailer < BaseUserMailer
SMTP_SETTINGS = ...
def initialize()
super(SMTP_SETTINGS)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment