feat: Notification on new messages in conversation (#1204)
fixes: #895 fixes: #1118 fixes: #1075 Co-authored-by: Pranav Raj S <pranav@thoughtwoot.com>
This commit is contained in:
@@ -4,7 +4,7 @@ class ContactAvatarJob < ApplicationJob
|
||||
def perform(contact, avatar_url)
|
||||
avatar_resource = LocalResource.new(avatar_url)
|
||||
contact.avatar.attach(io: avatar_resource.file, filename: avatar_resource.tmp_filename, content_type: avatar_resource.encoding)
|
||||
rescue Errno::ETIMEDOUT, Errno::ECONNREFUSED, SocketError => e
|
||||
Rails.logger.info "invalid url #{file_url} : #{e.message}"
|
||||
rescue Errno::ETIMEDOUT, Errno::ECONNREFUSED, SocketError, NoMethodError => e
|
||||
Rails.logger.info "invalid url #{avatar_url} : #{e.message}"
|
||||
end
|
||||
end
|
||||
|
||||
@@ -2,6 +2,9 @@ class Notification::EmailNotificationJob < ApplicationJob
|
||||
queue_as :default
|
||||
|
||||
def perform(notification)
|
||||
# no need to send email if notification has been read already
|
||||
return if notification.read_at.present?
|
||||
|
||||
Notification::EmailNotificationService.new(notification: notification).perform
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user