Bugfix: Private notes in emails & broken Signup (#1068)
* Bugfix: Private notes in emails Private notes were sent in the emails as part of conversation continuity. Fixed this issue. Also made the changes to not even queue the mails if message is a private note. * Bugfix: Change issue with featurable in signup - passing array * Bugfix: Added specs for checking private notes being sent in email
This commit is contained in:
@@ -55,6 +55,6 @@ module Featurable
|
||||
return true if config.blank?
|
||||
|
||||
features_to_enabled = config.value.select { |f| f[:enabled] }.map { |f| f[:name] }
|
||||
enable_features(features_to_enabled)
|
||||
enable_features(*features_to_enabled)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -146,7 +146,7 @@ class Message < ApplicationRecord
|
||||
end
|
||||
|
||||
def notify_via_mail
|
||||
if Redis::Alfred.get(conversation_mail_key).nil? && conversation.contact.email? && outgoing?
|
||||
if Redis::Alfred.get(conversation_mail_key).nil? && conversation.contact.email? && outgoing? && !private
|
||||
# set a redis key for the conversation so that we don't need to send email for every
|
||||
# new message that comes in and we dont enque the delayed sidekiq job for every message
|
||||
Redis::Alfred.setex(conversation_mail_key, Time.zone.now)
|
||||
|
||||
Reference in New Issue
Block a user