Class: Msg::MsgMailer

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

Instance Method Summary collapse

Instance Method Details

#message_in_envelope(envelope) ⇒ Object

we send all messages through SES and use SNS to notify of bounces, so all the return-path and VERP and other gubbins that we would normally need can be omitted



9
10
11
12
13
14
15
16
17
18
19
20
# File 'app/mailers/msg/msg_mailer.rb', line 9

def message_in_envelope(envelope)
  headers['Message-ID'] = envelope.email_id
  @envelope = envelope
  @message = envelope.message
  @receiver = envelope.receiver
  @contents = envelope.contents
  mail({
    :to => %{"#{@receiver.name}" <#{@receiver.email}>},
    :from => envelope.from_address,
    :subject => envelope.subject
  })
end