Sha256: f02bec8f5fc0a00d8404924f8e1402a3f3acaa0ffbf315c0809355d17832f0f8
Contents?: true
Size: 894 Bytes
Versions: 9
Compression:
Stored size: 894 Bytes
Contents
require 'action_mailer/railtie' module MnoEnterprise # Base class (instantiable) for SMTP adapter class SmtpClient < ActionMailer::Base # Send SMTP template - terminal mailing part def deliver(template, from, to, vars={}, opts={}) @info = vars @info[:company] = from[:name] mail( from: format_sender(from), to: to[:email], subject: humanize(template), template_path: 'system_notifications', template_name: template ) end # Returns Actionmailer-compliant :from string # @Format : "Sender name <sender@email.com>" def format_sender(from) "#{from[:name]} <#{from[:email]}>" end # Returns humanized template subject # @i.e. "reset-password-instructions" to "Reset password instructions" def humanize(template_slug) template_slug.tr("-", "_").humanize end end end
Version data entries
9 entries across 9 versions & 1 rubygems