Skip to content

Instantly share code, notes, and snippets.

@laser
Created April 14, 2014 17:30
Show Gist options
  • Save laser/10667730 to your computer and use it in GitHub Desktop.
Save laser/10667730 to your computer and use it in GitHub Desktop.
04: MailService Implementation
# services/mail_service/implementation.rb
class MailService
def send_email(from, to, subject, body)
opts = { from: from, to: to, subject: subject, body: body }
mail = ActionMailer::Base.mail opts
!!mail.deliver # return true if we're g2g
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment