Class | AsyncMailer |
In: |
app/models/async_mailer.rb
|
Parent: | ActionMailer::Base |
画面遷移と非同期にメールを送信するモデル
メールの書式化を行う。
# File app/models/async_mailer.rb, line 5 5: def formatted_mail(mail_history, sent_at = Time.now) 6: subject mail_history.subject 7: body :formatted_body => mail_history.body 8: from mail_history.from_value 9: sent_on sent_at 10: # headers 11: queue = mail_history.mail_queue 12: case queue.field_type 13: when "cc" 14: cc mail_history.recipient_value 15: when "bcc" 16: bcc mail_history.recipient_value 17: else 18: recipients mail_history.recipient_value 19: end 20: if queue.has_attachment? 21: queue.document.attachments.each do |a| 22: attachment :content_type => a.file.mime_type, :body => a.file.content 23: end 24: end 25: end