mirror of
https://github.com/discourse/discourse.git
synced 2024-11-24 05:34:28 +08:00
80858bae2c
- send email to logged in admin when they press the "download" button - show pop-up that email was sent - create email template - require a valid token to download backup
23 lines
571 B
Ruby
23 lines
571 B
Ruby
require_dependency 'email/sender'
|
|
|
|
module Jobs
|
|
|
|
class DownloadBackupEmail < Jobs::Base
|
|
|
|
sidekiq_options queue: 'critical'
|
|
|
|
def execute(args)
|
|
to_address = args[:to_address]
|
|
backup_file_path = args[:backup_file_path]
|
|
|
|
raise Discourse::InvalidParameters.new(:to_address) if to_address.blank?
|
|
raise Discourse::InvalidParameters.new(:backup_file_path) if backup_file_path.blank?
|
|
|
|
message = DownloadBackupMailer.send_email(to_address, backup_file_path)
|
|
Email::Sender.new(message, :download_backup_message).send
|
|
end
|
|
|
|
end
|
|
|
|
end
|