Skip to content

Instantly share code, notes, and snippets.

@ciaranarcher
Created November 3, 2011 09:43
Show Gist options
  • Save ciaranarcher/1336149 to your computer and use it in GitHub Desktop.
Save ciaranarcher/1336149 to your computer and use it in GitHub Desktop.
Email Helper
# Helper class for sending emails.
#
# @author Ciaran Archer
class EmailHelper
# @author Ciaran Archer
# @param [String] to
# @param [String] subject
# @param [String] body
# @param [String] from
# @return [nil]
# @todo we can add whatever logging / headers etc. we wish here
def send_email(to, subject, body, from="[email protected]")
Mail.new(
to: to,
from: from,
subject: subject,
body: body,
content_type: 'text/html; charset=UTF-8'
).deliver!
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment