Module: MailControl::Actor
- Extended by:
- ActiveSupport::Concern
- Defined in:
- lib/mail-control/actor.rb
Defined Under Namespace
Modules: ClassMethods
Instance Method Summary collapse
- #actor_logged_emails(options = {}) ⇒ Object
- #mail_control_class ⇒ Object
-
#send_email(name, options = {}) ⇒ Object
Publishes the mailing to the receivers.
Instance Method Details
#actor_logged_emails(options = {}) ⇒ Object
46 47 48 49 50 51 52 53 54 |
# File 'lib/mail-control/actor.rb', line 46 def actor_logged_emails( = {}) if .empty? logged_emails else logged_emails.where() end end |
#mail_control_class ⇒ Object
42 43 44 |
# File 'lib/mail-control/actor.rb', line 42 def mail_control_class @mailing_klass ||= mailing_klass ? mailing_klass.classify.constantize : ::LoggedEmail end |
#send_email(name, options = {}) ⇒ Object
Publishes the mailing to the receivers
32 33 34 35 36 37 38 39 40 |
# File 'lib/mail-control/actor.rb', line 32 def send_email(name, ={}) [:send_after] = Time.now + [:send_after] if [:send_after].kind_of?(Fixnum) [:send_before] = Time.now + [:send_before] if [:send_before].kind_of?(Fixnum) raise "Expected Time type. Got:" + [:send_after].class.name unless [:send_after].kind_of?(Time) raise "Expected Time type. Got:" + [:send_before].class.name unless [:send_before].kind_of?(Time) mail_control_class.send_email(name, {:actor => self}.merge()) end |