Sha256: ea984f56d1e359946df6ffdf7978d127d5d9d4b71d65b3cd71fcc1d6c69f6d29

Contents?: true

Size: 401 Bytes

Versions: 11

Compression:

Stored size: 401 Bytes

Contents

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

  def instructions(user)
    @user = user

    # normal syntax
    csv = render_to_string handlers: [:csvrb], template: 'users/send_instructions', layout: false, formats: [:csv]
    attachments["user_#{user.id}.csv"] = {mime_type: Mime[:csv], content: csv}

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

end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
csv_rb-6.0.3.1 spec/dummy/app/mailers/notifier.rb
csv_rb-6.0.2.4 spec/dummy/app/mailers/notifier.rb
csv_rb-6.0.2.3 spec/dummy/app/mailers/notifier.rb
csv_rb-6.0.2.2 spec/dummy/app/mailers/notifier.rb
csv_rb-6.0.2.1 spec/dummy/app/mailers/notifier.rb
csv_rb-5.2.3.2 spec/dummy/app/mailers/notifier.rb
csv_rb-5.2.3.1 spec/dummy/app/mailers/notifier.rb
csv_rb-5.2.3 spec/dummy/app/mailers/notifier.rb
csv_rb-5.2.2 spec/dummy/app/mailers/notifier.rb
csv_rb-5.2.1 spec/dummy/app/mailers/notifier.rb
csv_rb-0.5.2 spec/dummy/app/mailers/notifier.rb