An error occurred while fetching the assigned milestone of the selected merge_request.
Add notification to the former assignee upon unassignment
Adding new feature - Issue #3395 (closed). Upon unassignment of a user from issue add him to the recipients of the assignee changed notification email. Feedback is more than welcomed :)
This was implemented while being watched by @DouweM .
Fixes #3395 (closed)
Merge request reports
Activity
👍 How does it feel to be watched by @DouweM? :)
362 362 363 363 def reassign_resource_email(target, project, current_user, method) 364 364 assignee_id_was = previous_record(target, "assignee_id") 365 recipients = build_recipients(target, project, current_user) 365 previous_assignee = User.find(assignee_id_was) 377 378 end 378 379 end 379 380 380 def build_recipients(target, project, current_user) 381 def build_recipients(target, project, current_user, previous_records = nil ) 381 382 recipients = target.participants(current_user) 383 recipients.concat(previous_records).compact.uniq if previous_records 34 34 it { expect(@issue.labels.count).to eq(1) } 35 35 it { expect(@issue.labels.first.title).to eq('Bug') } 36 36 37 it 'should send email to user2 about assign of new issue' do 38 email = ActionMailer::Base.deliveries.last 39 expect(email.to.first).to eq(user2.email) 37 it 'should send email to user2 about assign of new issue and email to user about issue unassignment' do 38 deliveries = ActionMailer::Base.deliveries 39 email = deliveries.last 40 recipients = deliveries.map(&:to).uniq.flatten 41 expect(recipients.last(2)).to include(user.email,user2.email) Please add a space after
,
.Edited by Douwe Maan
mentioned in merge request !1818 (merged)
@adamliesko Thanks again for your work! I created !1818 (merged) based on this MR with a little bit of added refactoring.
mentioned in commit b1abe90a
mentioned in commit c9f03247
Please register or sign in to reply