views:

19

answers:

0

So ive got a ActionMailer mailer

class ReportMailer < ActionMailer::Base
  def notify_doctor_of_updated_document(document)
    recipients  document.user.email_id
    from        "(removed for privacy)"
    subject     "Document #{document.document_number} has been updated and saved as #{document.status}"
    sent_on     Time.now
    body        :document => document
  end
end

and the view is

Document
<%= @document.class %>

but when running

>> d = Document.last
=> #<Document id: "fff52d70-7ba2-11de-9b70-001ec9e252ed", document_number: "ABCD1234", procedures_count: 0, user_id: "630", created_at: "2009-07-28 18:18:07", updated_at: "2009-08-30 20:59:41", active: false, facility_id: 94157, status: "incomplete", staff_id: nil, transcriptionist_id: nil, job_length: nil, work_type: nil, transcription_date: nil, non_trans_edit_date: nil, pervasync_flag: true, old_id: nil>
>> ReportMailer.deliver_notify_doctor_of_updated_document(d)
=> #<TMail::Mail port=#<TMail::StringPort:id=0x8185326c> bodyport=#<TMail::StringPort:id=0x8184d6b4>>

from the console this is printed in the log

Sent mail to (removed for privacy)

Date: Tue, 11 May 2010 20:45:14 -0500
From: (removed for privacy)
To: (removed for privacy)
Subject: Document ABCD1234 has been updated and saved as incomplete
Mime-Version: 1.0
Content-Type: multipart/alternative; boundary=mimepart_4bea082ab4ae8_aa4800b81ac13f5


--mimepart_4bea082ab4ae8_aa4800b81ac13f5
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: Quoted-printable
Content-Disposition: inline

Document
NilClass=

--mimepart_4bea082ab4ae8_aa4800b81ac13f5--