Class: Mailman

Inherits:
ActionMailer::Base
  • Object
show all
Defined in:
app/mailers/mailman.rb

Instance Method Summary collapse

Instance Method Details

#mailing(expedier, recipient, subject, text, piece = nil) ⇒ Object


3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# File 'app/mailers/mailman.rb', line 3

def mailing(expedier, recipient, subject, text, piece = nil)
  # from       expedier
  # recipients recipient
  # subject    subject
  # body       :text=>text
  @text = text
  if piece
    attachments[piece[:filename]] = piece[:body]
    # attachment piece
    # (:content_type => piece.content_type,
    #                  :body => piece.read,
    #                  :filename=>piece.original_filename)
  end
  mail(from: expedier, to: recipient, subject: subject)
end