Add ActionMailer to inform admins about new screenshots

This version only informs Christoph as a test
This commit is contained in:
Christoph Haas 2021-02-25 02:43:14 +01:00
parent ae597a6235
commit 1f9187e35c
9 changed files with 55 additions and 1 deletions

View file

@ -123,6 +123,11 @@ class PackagesController < ApplicationController
# if @invalid_images…
# ' #{image.image_file_name} (#{image.errors[:image].join(' and ')})
# Inform the admins about the upload
if @valid_images.any?
AdminMailer.with(package: @package).new_uploads_email.deliver_now
end
# Rails does not allow dots in the URL. So we cannot use the 'respond_to'
# and 'format' ways to handle parameters. Instead the 'returns' parameters
# is set in routes.rb to signal that this method was called by AJAX.