Newsletter: Address to self.
An empty To: header is rejected by WEB.DE. Therefore, adding a
primary recipient is necessary even if no obvious one exists.
This change makes the NewsletterSender's own address the primary
recipient, circumventing the problem.
Change-Id: I78febdd1f57b3f5737d83334972867ec9e4781d8
diff --git a/src/main/java/eu/mulk/mulkcms2/benki/newsletter/NewsletterSender.java b/src/main/java/eu/mulk/mulkcms2/benki/newsletter/NewsletterSender.java
index 7a52d32..8c8c9b6 100644
--- a/src/main/java/eu/mulk/mulkcms2/benki/newsletter/NewsletterSender.java
+++ b/src/main/java/eu/mulk/mulkcms2/benki/newsletter/NewsletterSender.java
@@ -37,6 +37,9 @@
@ConfigProperty(name = "mulkcms.newsletter.time-zone")
ZoneId newsletterTimeZone;
+ @ConfigProperty(name = "quarkus.mailer.from")
+ String senderAddress;
+
@PersistenceContext EntityManager em;
@CheckedTemplate
@@ -100,6 +103,7 @@
var sendJob =
mailText
.subject(String.format("MulkCMS newsletter #%d", newsletterNumber))
+ .to(senderAddress)
.bcc(subscriberEmails)
.send();
sendJob.toCompletableFuture().get(10000, TimeUnit.SECONDS);