Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIX: send single report PM to groups #284

Merged
merged 7 commits into from
Mar 27, 2024

Conversation

dbattersby
Copy link
Contributor

@dbattersby dbattersby commented Mar 22, 2024

The main change here is that we now send a single PM to a group rather than individual PMs to each group member.

We are also now setting email recipients correctly as target_emails, support was added for emails in this change.

@@ -2,30 +2,24 @@

module ::DiscourseDataExplorer
class ReportGenerator
def initialize(creator_user_id)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No longer needed as the PM is sent by the system user anyway.

return [] if recipients.empty?

creator = User.find_by(id: @creator_user_id)
return [] unless Guardian.new(creator).can_send_private_messages?
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not needed as the PM is sent by the system user.

@dbattersby dbattersby marked this pull request as draft March 22, 2024 10:18
@dbattersby dbattersby force-pushed the send-single-report-pm-to-groups branch from 8b06b8f to fa976a4 Compare March 26, 2024 05:13
@dbattersby dbattersby force-pushed the send-single-report-pm-to-groups branch from fa976a4 to 410ac93 Compare March 26, 2024 05:15
@dbattersby dbattersby marked this pull request as ready for review March 26, 2024 06:43
lib/report_generator.rb Outdated Show resolved Hide resolved
Copy link
Contributor

@jjaffeux jjaffeux left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@dbattersby dbattersby merged commit cde34fb into main Mar 27, 2024
5 checks passed
@dbattersby dbattersby deleted the send-single-report-pm-to-groups branch March 27, 2024 09:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants