Sha256: 100dd3885672df150cbe69ad063619176d44a666d8246d58bc1a8e4f488b15bb

Contents?: true

Size: 691 Bytes

Versions: 10

Compression:

Stored size: 691 Bytes

Contents

class IshManager::OfficeMailer < IshManager::ApplicationMailer
  default from: 'piousbox@gmail.com'
  # layout 'mailer'

  def send_context_email ctx_id
    @email_ctx = ::Ish::EmailContext.find ctx_id
    template = "render/_#{@email_ctx.email_template.slug}"

    ac = ActionController::Base.new
    ac.instance_variable_set( :@email_ctx, @email_ctx )
    rendered_str = ac.render_to_string("ish_manager/email_templates/_#{@email_ctx.email_template.slug}")
    @email_ctx.update( rendered_str: rendered_str, sent_at: Time.now )

    mail( to: @email_ctx.to_email,
          bcc: 'piousbox@gmail.com',
          subject: @email_ctx.subject,
          template_name: template )

  end

end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
ish_manager-0.1.8.327 app/mailers/ish_manager/office_mailer.rb
ish_manager-0.1.8.326 app/mailers/ish_manager/office_mailer.rb
ish_manager-0.1.8.325 app/mailers/ish_manager/office_mailer.rb
ish_manager-0.1.8.324 app/mailers/ish_manager/office_mailer.rb
ish_manager-0.1.8.323 app/mailers/ish_manager/office_mailer.rb
ish_manager-0.1.8.322 app/mailers/ish_manager/office_mailer.rb
ish_manager-0.1.8.321 app/mailers/ish_manager/office_mailer.rb
ish_manager-0.1.8.320 app/mailers/ish_manager/office_mailer.rb
ish_manager-0.1.8.318 app/mailers/ish_manager/office_mailer.rb
ish_manager-0.1.8.317 app/mailers/ish_manager/office_mailer.rb