Skip to content

Commit 1dcf2ce

Browse files
fixed issue in newsletter send nullifying status
1 parent 62f742f commit 1dcf2ce

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

app/workers/light/hard_worker.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ class HardWorker
55

66
def perform(user_ids, newsletter_id, date, status = nil)
77
newsletter = Light::Newsletter.where(id: newsletter_id).first
8-
user_ids.each do |id|
8+
user_ids.each do |id|
99
user = Light::User.where(id: id, :sent_on.nin => [date]).first
1010
if user.present?
1111
Light::UserMailer.welcome_message(user.email_id, newsletter, user.token).deliver
@@ -15,12 +15,12 @@ def perform(user_ids, newsletter_id, date, status = nil)
1515
sidekiq_status: status,
1616
opt_in_mail_sent_at: DateTime.now)
1717
elsif status.present? && status.include?('Opt out')
18-
user.update_attributes(sent_on: sent_on,
18+
user.update_attributes(sent_on: sent_on,
1919
sidekiq_status: 'Subscribed',
2020
subscribed_at: DateTime.now,
2121
is_subscribed: true)
2222
else
23-
user.update_attributes(sent_on: sent_on, sidekiq_status: status)
23+
user.update_attributes(sent_on: sent_on)
2424
end
2525
end
2626
end

0 commit comments

Comments
 (0)