Class: BMC::Email
- Inherits:
-
Object
- Object
- BMC::Email
- Defined in:
- app/emails/bmc/email.rb
Constant Summary
Constants included from ModelI18n
ModelI18n::MissingTranslationError
Instance Attribute Summary collapse
-
#body ⇒ Object
Returns the value of attribute body.
-
#cc ⇒ Object
Returns the value of attribute cc.
-
#current_user ⇒ Object
Returns the value of attribute current_user.
-
#from ⇒ Object
Returns the value of attribute from.
-
#reply_to ⇒ Object
Returns the value of attribute reply_to.
-
#subject ⇒ Object
Returns the value of attribute subject.
-
#to ⇒ Object
Returns the value of attribute to.
Instance Method Summary collapse
- #attachment_names ⇒ Object
- #data ⇒ Object
- #deliver ⇒ Object
- #deliver_later ⇒ Object
- #deliver_now ⇒ Object
-
#initialize ⇒ Email
constructor
A new instance of Email.
- #validate_and_deliver ⇒ Object
Methods included from ModelI18n
Methods included from ModelToS
Constructor Details
#initialize ⇒ Email
Returns a new instance of Email.
23 24 25 26 |
# File 'app/emails/bmc/email.rb', line 23 def initialize(*) super assign_default_values end |
Instance Attribute Details
#body ⇒ Object
Returns the value of attribute body.
12 13 14 |
# File 'app/emails/bmc/email.rb', line 12 def body @body end |
#cc ⇒ Object
Returns the value of attribute cc.
12 13 14 |
# File 'app/emails/bmc/email.rb', line 12 def cc @cc end |
#current_user ⇒ Object
Returns the value of attribute current_user.
12 13 14 |
# File 'app/emails/bmc/email.rb', line 12 def current_user @current_user end |
#from ⇒ Object
Returns the value of attribute from.
12 13 14 |
# File 'app/emails/bmc/email.rb', line 12 def from @from end |
#reply_to ⇒ Object
Returns the value of attribute reply_to.
12 13 14 |
# File 'app/emails/bmc/email.rb', line 12 def reply_to @reply_to end |
#subject ⇒ Object
Returns the value of attribute subject.
12 13 14 |
# File 'app/emails/bmc/email.rb', line 12 def subject @subject end |
#to ⇒ Object
Returns the value of attribute to.
12 13 14 |
# File 'app/emails/bmc/email.rb', line 12 def to @to end |
Instance Method Details
#attachment_names ⇒ Object
28 29 30 |
# File 'app/emails/bmc/email.rb', line 28 def .keys.join(", ") end |
#data ⇒ Object
38 39 40 41 42 43 44 45 46 47 48 |
# File 'app/emails/bmc/email.rb', line 38 def data { :from => from, :reply_to => reply_to, :to => to, :cc => cc, :subject => subject, :body => body, :attachments => , } end |
#deliver ⇒ Object
50 51 52 |
# File 'app/emails/bmc/email.rb', line 50 def deliver deliver_now end |
#deliver_later ⇒ Object
58 59 60 |
# File 'app/emails/bmc/email.rb', line 58 def deliver_later BMC::GenericMailer.generic_email(data).deliver_later end |
#deliver_now ⇒ Object
54 55 56 |
# File 'app/emails/bmc/email.rb', line 54 def deliver_now BMC::GenericMailer.generic_email(data).deliver_now end |
#validate_and_deliver ⇒ Object
32 33 34 35 36 |
# File 'app/emails/bmc/email.rb', line 32 def validate_and_deliver ok = valid? deliver if ok ok end |