0
0
Fork 0

Add ability to email announcements to all users (#33928)

This commit is contained in:
Claire 2025-03-06 15:05:27 +01:00 committed by GitHub
parent d2ce9a6064
commit 5a100bf38f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
20 changed files with 275 additions and 11 deletions

View file

@ -0,0 +1,17 @@
# frozen_string_literal: true
class Admin::Announcements::TestsController < Admin::BaseController
before_action :set_announcement
def create
authorize @announcement, :distribute?
UserMailer.announcement_published(current_user, @announcement).deliver_later!
redirect_to admin_announcements_path
end
private
def set_announcement
@announcement = Announcement.find(params[:announcement_id])
end
end