Module: Tolliver

Defined in:
lib/tolliver/engine.rb,
lib/tolliver.rb,
lib/tolliver/utils/enum.rb,
lib/tolliver/errors/not_found.rb,
lib/tolliver/jobs/delivery_job.rb,
lib/tolliver/errors/bad_request.rb,
app/models/tolliver/notification.rb,
lib/tolliver/models/notification.rb,
lib/tolliver/services/methods/sms.rb,
lib/tolliver/errors/standard_error.rb,
lib/tolliver/jobs/batch_policy_job.rb,
lib/tolliver/services/methods/email.rb,
lib/tolliver/services/methods/slack.rb,
lib/tolliver/services/policies/batch.rb,
lib/tolliver/services/delivery_service.rb,
lib/tolliver/services/methods/sms/plivo.rb,
app/mailers/tolliver/notification_mailer.rb,
lib/tolliver/mailers/notification_mailer.rb,
lib/tolliver/services/methods/email/smtp.rb,
lib/tolliver/services/policies/instantly.rb,
app/models/tolliver/notification_delivery.rb,
app/models/tolliver/notification_receiver.rb,
app/models/tolliver/notification_template.rb,
lib/tolliver/models/notification_delivery.rb,
lib/tolliver/models/notification_receiver.rb,
lib/tolliver/models/notification_template.rb,
lib/tolliver/services/notification_service.rb,
app/models/tolliver/notification_attachment.rb,
lib/tolliver/models/notification_attachment.rb,
lib/tolliver/services/methods/email/mailgun.rb

Overview

*****************************************************************************

  • Copyright © 2019 Matěj Outlý

***************************************************************************** *

  • Mailgun e-mail provider

*

  • Author: Matěj Outlý

  • Date : 1. 12. 2017

* *****************************************************************************

Defined Under Namespace

Modules: Errors, Jobs, Mailers, Models, Services, Utils Classes: Engine, Notification, NotificationAttachment, NotificationDelivery, NotificationMailer, NotificationReceiver, NotificationTemplate

Constant Summary collapse

@@notification_model =
"Tolliver::Notification"
@@notification_attachment_model =
"Tolliver::NotificationAttachment"
@@notification_delivery_model =
"Tolliver::NotificationDelivery"
@@notification_receiver_model =
"Tolliver::NotificationReceiver"
@@notification_template_model =
"Tolliver::NotificationTemplate"
@@delivery_methods =
[
    :email
]
@@load_balance =
nil
@@email_provider =
:smtp
@@email_provider_params =
{}
@@sms_provider =
:plivo
@@sms_provider_params =
{}
@@slack_params =
{}

Class Method Summary collapse

Class Method Details

.deliver(notification) ⇒ Object



63
64
65
# File 'lib/tolliver.rb', line 63

def self.deliver(notification)
  Tolliver::Services::DeliveryService.instance.deliver(notification)
end

.enqueue_for_delivery(notification) ⇒ Object



67
68
69
# File 'lib/tolliver.rb', line 67

def self.enqueue_for_delivery(notification)
  Tolliver::Services::DeliveryService.instance.enqueue_for_delivery(notification)
end

.notification_attachment_modelObject



100
101
102
# File 'lib/tolliver.rb', line 100

def self.notification_attachment_model
  return @@notification_attachment_model.constantize
end

.notification_delivery_modelObject



109
110
111
# File 'lib/tolliver.rb', line 109

def self.notification_delivery_model
  return @@notification_delivery_model.constantize
end

.notification_modelObject



91
92
93
# File 'lib/tolliver.rb', line 91

def self.notification_model
  return @@notification_model.constantize
end

.notification_receiver_modelObject



118
119
120
# File 'lib/tolliver.rb', line 118

def self.notification_receiver_model
  return @@notification_receiver_model.constantize
end

.notification_template_modelObject



127
128
129
# File 'lib/tolliver.rb', line 127

def self.notification_template_model
  return @@notification_template_model.constantize
end

.notify(options) ⇒ Object

************************************************************************* Services *************************************************************************



59
60
61
# File 'lib/tolliver.rb', line 59

def self.notify(options)
  Tolliver::Services::NotificationService.instance.notify(options)
end

.reset_delivery(notification) ⇒ Object



71
72
73
# File 'lib/tolliver.rb', line 71

def self.reset_delivery(notification)
  Tolliver::Services::DeliveryService.instance.reset_delivery(notification)
end

.setup {|_self| ... } ⇒ Object

Default way to setup module

Yields:

  • (_self)

Yield Parameters:

  • _self (Tolliver)

    the object that the method was called on



80
81
82
# File 'lib/tolliver.rb', line 80

def self.setup
  yield self
end

.table_name_prefixObject

This will keep Rails Engine from generating all table prefixes with the engines name



52
53
# File 'lib/tolliver.rb', line 52

def self.table_name_prefix
end