From 818853a18bbb7c68a79285d80377e04bbce94206 Mon Sep 17 00:00:00 2001 From: thisismeonmounteverest Date: Sun, 22 Oct 2023 16:53:08 +0200 Subject: [PATCH] Use message@bewelcome.org as sender for suspension notification. Remove hint for no unsubscribe option. Add missing file for gallery update. --- src/Command/SendMassmailCommand.php | 3 +++ src/Entity/Newsletter.php | 2 +- src/Form/GalleryUploadForm.php | 12 ++++++++---- templates/emails/newsletter.html.twig | 5 ++--- 4 files changed, 14 insertions(+), 8 deletions(-) diff --git a/src/Command/SendMassmailCommand.php b/src/Command/SendMassmailCommand.php index f94dac6985..06ce758c96 100644 --- a/src/Command/SendMassmailCommand.php +++ b/src/Command/SendMassmailCommand.php @@ -149,6 +149,9 @@ private function determineSender($type): Address case 'TermsOfUse': $sender = new Address('tou@bewelcome.org', 'BeWelcome'); break; + case Newsletter::SUSPENSION_NOTIFICATION: + $sender = new Address('message@bewelcome.org', 'BeWelcome'); + break; default: $sender = new Address('newsletter@bewelcome.org', 'BeWelcome'); } diff --git a/src/Entity/Newsletter.php b/src/Entity/Newsletter.php index 786a7b74bd..1d4cae1ca1 100644 --- a/src/Entity/Newsletter.php +++ b/src/Entity/Newsletter.php @@ -21,7 +21,7 @@ class Newsletter implements ObjectManagerAware public const REGULAR_NEWSLETTER = 'Normal'; public const SPECIFIC_NEWSLETTER = 'Specific'; public const TERMS_OF_USE = 'TermsOfUse'; - + public const SUSPENSION_NOTIFICATION = 'SuspendAfter5Reminders'; /** * @var Member * diff --git a/src/Form/GalleryUploadForm.php b/src/Form/GalleryUploadForm.php index a45fe0592d..64848f8f6a 100644 --- a/src/Form/GalleryUploadForm.php +++ b/src/Form/GalleryUploadForm.php @@ -5,8 +5,10 @@ use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\Extension\Core\Type\FileType; use Symfony\Component\Form\Extension\Core\Type\SubmitType; +use Symfony\Component\Form\Extension\Core\Type\TextType; use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\OptionsResolver\OptionsResolver; +use Symfony\Component\Validator\Constraints\NotBlank; class GalleryUploadForm extends AbstractType { @@ -16,11 +18,13 @@ class GalleryUploadForm extends AbstractType public function buildForm(FormBuilderInterface $builder, array $options) { $builder - ->add('albums', Select2Type::class, [ + ->add('albums', TextType::class, [ 'label' => 'gallery.upload_to_album', - 'choices' => $options['albums'], - 'choice_translation_domain' => false, - 'searchbox' => false, + 'autocomplete' => true, + 'required' => false, + 'autocomplete_choices' => $options['albums'], + 'allow_options_create' => true, + 'max_items' => 1, ]) ->add('files', FileType::class, [ 'label' => 'files', diff --git a/templates/emails/newsletter.html.twig b/templates/emails/newsletter.html.twig index 0389cf523c..0b76f0f895 100644 --- a/templates/emails/newsletter.html.twig +++ b/templates/emails/newsletter.html.twig @@ -11,7 +11,6 @@ - {% if has_images is defined %} @@ -21,7 +20,7 @@ {% endif %} - + {{ wordcode|trans({'gender': receiver.gender, 'username': receiver.username})|prepare_newsletter }} @@ -39,6 +38,7 @@ {{ 'newsletter.local.unsubscribe'|trans }} {% elseif constant('\\App\\Entity\\Newsletter::REGULAR_NEWSLETTER') == newsletter.type %} {{ 'newsletter.regular.unsubscribe'|trans }} + {% elseif constant('\\App\\Entity\\Newsletter::SUSPENSION_NOTIFICATION') == newsletter.type %} {% else %} {{ 'newsletter.no.unsubscribe'|trans }} {% endif %} @@ -48,7 +48,6 @@ - {% endapply %} {% endblock %}