Class: DelayedTrigger
- Inherits:
-
Struct
- Object
- Struct
- DelayedTrigger
- Defined in:
- lib/delayed_trigger.rb
Instance Attribute Summary collapse
-
#attributes ⇒ Object
Returns the value of attribute attributes.
-
#email ⇒ Object
Returns the value of attribute email.
-
#mail_type ⇒ Object
Returns the value of attribute mail_type.
-
#message_name ⇒ Object
Returns the value of attribute message_name.
-
#store_code ⇒ Object
Returns the value of attribute store_code.
Instance Method Summary collapse
Instance Attribute Details
#attributes ⇒ Object
Returns the value of attribute attributes
1 2 3 |
# File 'lib/delayed_trigger.rb', line 1 def attributes @attributes end |
#email ⇒ Object
Returns the value of attribute email
1 2 3 |
# File 'lib/delayed_trigger.rb', line 1 def email @email end |
#mail_type ⇒ Object
Returns the value of attribute mail_type
1 2 3 |
# File 'lib/delayed_trigger.rb', line 1 def mail_type @mail_type end |
#message_name ⇒ Object
Returns the value of attribute message_name
1 2 3 |
# File 'lib/delayed_trigger.rb', line 1 def @message_name end |
#store_code ⇒ Object
Returns the value of attribute store_code
1 2 3 |
# File 'lib/delayed_trigger.rb', line 1 def store_code @store_code end |
Instance Method Details
#perform ⇒ Object
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/delayed_trigger.rb', line 2 def perform return if email.blank? begin token= Spree::BrontoConfiguration.account[store_code]['token'] from_email= Spree::Store.current.mail_from_address from_name= Spree::BrontoConfiguration.account[store_code]['from_name'] reply_email= Spree::Store.current.mail_from_address ={:fromEmail =>from_email,:fromName => from_name, :replyEmail => reply_email} communication = BrontoIntegration::Communication.new(token) communication.trigger_delivery_by_id(,email,'triggered',mail_type||'html',attributes||{},) rescue => exception #raise exception # as now only campaign use this and their templates may not be approved. let it go. end end |