Sha256: 80514603436b80a9b68830600d5796dbd1361847bb1045df376fe42bac45c884

Contents?: true

Size: 390 Bytes

Versions: 8

Compression:

Stored size: 390 Bytes

Contents

class Notifier < ActionMailer::Base
  default :from => 'noreply@company.com'

  def instructions(user)
    @user = user

    # normal syntax
    xlsx = render_to_string handlers: [:axlsx], template: 'users/mailers/instructions', layout: false
    attachments["user_#{user.id}.xlsx"] = {mime_type: Mime::XLSX, content: xlsx}

    mail :to => user.email, :subject => 'Instructions'
  end

end

Version data entries

8 entries across 4 versions & 1 rubygems

Version Path
axlsx_rails-0.4.0 spec/dummy/app/mailers/notifier.rb
axlsx_rails-0.4.0 spec/dummy_4/app/mailers/notifier.rb
axlsx_rails-0.3.0 spec/dummy/app/mailers/notifier.rb
axlsx_rails-0.3.0 spec/dummy_4/app/mailers/notifier.rb
axlsx_rails-0.2.1 spec/dummy/app/mailers/notifier.rb
axlsx_rails-0.2.1 spec/dummy_4/app/mailers/notifier.rb
axlsx_rails-0.2.0 spec/dummy/app/mailers/notifier.rb
axlsx_rails-0.2.0 spec/dummy_4/app/mailers/notifier.rb