Class: Notification

Inherits:
ActionMailer::Base
  • Object
show all
Defined in:
lib/public/doc/mail/mail-20.rb,
lib/public/doc/mail/mail-21.rb

Instance Method Summary collapse

Instance Method Details

#directory_dump(recipient, directory = Dir.pwd) ⇒ Object



30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'lib/public/doc/mail/mail-21.rb', line 30

def directory_dump(recipient, directory=Dir.pwd)
  from '[email protected]'
  content_type 'text/plain; charset=utf-8'
  recipients recipient
  subject "zdjęcia z katalogu: #{directory}"
  body %{Zdjęcia z katalogu: "#{directory}":}
  Dir.glob('*.jpeg') do |f|
    path = File.join(directory, f)
    attachment('image/jpeg') do |a|
      a.body = File.read(path)
      a.filename = f
      a.transfer_encoding = 'base64'
    end
  end
end

#signup_message(recipient) ⇒ Object



29
30
31
32
33
34
35
# File 'lib/public/doc/mail/mail-20.rb', line 29

def (recipient)
  from '[email protected]'
  content_type 'text/plain; charset=utf-8'
  recipients recipient
  subject 'action mailer test: 4'
  body 'Treść emaila #4.'
end