Class: NotificationEmailer::EmailUser
- Inherits:
-
Object
- Object
- NotificationEmailer::EmailUser
- Defined in:
- app/services/notification_emailer.rb
Instance Attribute Summary collapse
-
#no_delay ⇒ Object
readonly
Returns the value of attribute no_delay.
-
#notification ⇒ Object
readonly
Returns the value of attribute notification.
Class Method Summary collapse
Instance Method Summary collapse
- #group_mentioned ⇒ Object
-
#initialize(notification, no_delay: false) ⇒ EmailUser
constructor
A new instance of EmailUser.
- #invited_to_private_message ⇒ Object
- #invited_to_topic ⇒ Object
- #linked ⇒ Object
- #mentioned ⇒ Object
- #post_approved ⇒ Object
- #posted ⇒ Object
- #private_message ⇒ Object
- #quoted ⇒ Object
- #replied ⇒ Object
- #watching_category_or_tag ⇒ Object
- #watching_first_post ⇒ Object
Constructor Details
#initialize(notification, no_delay: false) ⇒ EmailUser
Returns a new instance of EmailUser.
7 8 9 10 |
# File 'app/services/notification_emailer.rb', line 7 def initialize(notification, no_delay: false) @notification = notification @no_delay = no_delay end |
Instance Attribute Details
#no_delay ⇒ Object (readonly)
Returns the value of attribute no_delay.
5 6 7 |
# File 'app/services/notification_emailer.rb', line 5 def no_delay @no_delay end |
#notification ⇒ Object (readonly)
Returns the value of attribute notification.
5 6 7 |
# File 'app/services/notification_emailer.rb', line 5 def notification @notification end |
Class Method Details
.notification_params(notification, type) ⇒ Object
60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 |
# File 'app/services/notification_emailer.rb', line 60 def self.notification_params(notification, type) post_id = (notification.data_hash[:original_post_id] || notification.post_id).to_i notification_type = Notification.types[notification.notification_type] hash = { type: type.to_s, user_id: notification.user_id, notification_id: notification.id, notification_data_hash: notification.data_hash, notification_type: notification_type.to_s, } hash[:post_id] = post_id if post_id > 0 && notification_type != :post_approved hash end |
Instance Method Details
#group_mentioned ⇒ Object
12 13 14 |
# File 'app/services/notification_emailer.rb', line 12 def group_mentioned enqueue :group_mentioned end |
#invited_to_private_message ⇒ Object
52 53 54 |
# File 'app/services/notification_emailer.rb', line 52 def enqueue(:user_invited_to_private_message, private_delay) end |
#invited_to_topic ⇒ Object
56 57 58 |
# File 'app/services/notification_emailer.rb', line 56 def invited_to_topic enqueue(:user_invited_to_topic, private_delay) end |
#linked ⇒ Object
36 37 38 |
# File 'app/services/notification_emailer.rb', line 36 def linked enqueue :user_linked end |
#mentioned ⇒ Object
16 17 18 |
# File 'app/services/notification_emailer.rb', line 16 def mentioned enqueue :user_mentioned end |
#post_approved ⇒ Object
44 45 46 |
# File 'app/services/notification_emailer.rb', line 44 def post_approved enqueue :post_approved end |
#posted ⇒ Object
20 21 22 |
# File 'app/services/notification_emailer.rb', line 20 def posted enqueue :user_posted end |
#private_message ⇒ Object
48 49 50 |
# File 'app/services/notification_emailer.rb', line 48 def enqueue_private(:user_private_message) end |
#quoted ⇒ Object
28 29 30 |
# File 'app/services/notification_emailer.rb', line 28 def quoted enqueue :user_quoted end |
#replied ⇒ Object
32 33 34 |
# File 'app/services/notification_emailer.rb', line 32 def replied enqueue :user_replied end |
#watching_category_or_tag ⇒ Object
24 25 26 |
# File 'app/services/notification_emailer.rb', line 24 def watching_category_or_tag enqueue :user_posted end |
#watching_first_post ⇒ Object
40 41 42 |
# File 'app/services/notification_emailer.rb', line 40 def watching_first_post enqueue :user_watching_first_post end |