Module: Msg

Defined in:
lib/msg/receivers.rb,
lib/msg.rb,
lib/msg/engine.rb,
lib/msg/version.rb,
app/models/msg/bounce.rb,
app/models/msg/message.rb,
app/models/msg/sending.rb,
app/models/msg/envelope.rb,
app/mailers/msg/msg_mailer.rb,
app/controllers/msg/engine_controller.rb,
app/controllers/msg/bounces_controller.rb,
app/controllers/msg/messages_controller.rb,
app/controllers/msg/sendings_controller.rb,
app/controllers/msg/envelopes_controller.rb

Overview

Msg::Receivers is for inclusion into ActiveRecord::Baseā€¦

Defined Under Namespace

Modules: ActiveRecordClassMethods, Receivers Classes: Bounce, BouncesController, EmailInvalid, Engine, EngineController, Envelope, EnvelopesController, Message, MessagesController, MsgError, MsgMailer, Sending, SendingsController

Constant Summary collapse

VERSION =
"0.5.0"

Class Method Summary collapse

Class Method Details

.add_receiving_class(klass, options) ⇒ Object



26
27
28
29
30
31
# File 'lib/msg.rb', line 26

def add_receiving_class(klass, options)
  k = klass.to_s
  receiving_classes << k unless receiving_classes.include?(k)
  klass.messaging_groups = options[:groups] || []
  Msg::Sending.add_receiver_hooks(klass, options)
end

.attributes_allowed_in_emailObject



73
74
75
# File 'lib/msg.rb', line 73

def attributes_allowed_in_email
  @@permitted_attributes ||= ActionView::Base.sanitized_allowed_attributes
end

.default_fromObject



57
58
59
# File 'lib/msg.rb', line 57

def default_from
  "#{default_from_name} <#{default_from_address}>"
end

.default_from_addressObject



49
50
51
# File 'lib/msg.rb', line 49

def default_from_address
  @@default_from_address ||= "[email protected]"
end

.default_from_nameObject



53
54
55
# File 'lib/msg.rb', line 53

def default_from_name
  @@default_from_name ||= "Someone Unknown"
end

.email_layoutObject



45
46
47
# File 'lib/msg.rb', line 45

def email_layout
  @@email_layout ||= "msg/email"
end

.email_valuesObject



61
62
63
# File 'lib/msg.rb', line 61

def email_values
  @@email_values ||= {}
end

.layoutObject



37
38
39
# File 'lib/msg.rb', line 37

def layout
  @@user_class ||= "User"
end

.receiving_classesObject



65
66
67
# File 'lib/msg.rb', line 65

def receiving_classes
  @@receiving_classes ||= []
end

.sending_domainObject



77
78
79
# File 'lib/msg.rb', line 77

def sending_domain
  @@sending_domain ||= ActionMailer::Base.default_url_options[:host]
end

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

Yields:

  • (_self)

Yield Parameters:

  • _self (Msg)

    the object that the method was called on



33
34
35
# File 'lib/msg.rb', line 33

def setup
  yield self
end

.tags_allowed_in_emailObject



69
70
71
# File 'lib/msg.rb', line 69

def tags_allowed_in_email
  @@permitted_tags ||= ActionView::Base.sanitized_allowed_tags.to_a
end