26 lines
547 B
Ruby
26 lines
547 B
Ruby
module JamRuby
|
|
class BatchMailer < ActionMailer::Base
|
|
include SendGrid
|
|
|
|
layout "batch_mailer"
|
|
|
|
DEFAULT_SENDER = "support@jamkazam.com"
|
|
|
|
default :from => DEFAULT_SENDER
|
|
|
|
sendgrid_category :batch_email
|
|
sendgrid_category :use_subject_lines
|
|
sendgrid_unique_args :env => Environment.mode
|
|
|
|
def send_batch_email(batch, user)
|
|
@user = user
|
|
@body = batch.merged_body(user)
|
|
mail(:to => user.email, :subject => batch.subject) do |format|
|
|
format.text
|
|
format.html
|
|
end
|
|
end
|
|
|
|
end
|
|
end
|