summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Andreas Benkard <code@mail.matthias.benkard.de>2021-02-06 11:31:27 +0100
committerMatthias Andreas Benkard <code@mail.matthias.benkard.de>2021-02-06 11:31:27 +0100
commitd4df22db3db5a30c285a5c40f69d70ceae17ff80 (patch)
treef2b4aab1290ebb730900fdf8f9182425c7995a2f
parentbee2f96bdf6562a1542a83f4afaea5ec648c4973 (diff)
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
-rw-r--r--src/main/java/eu/mulk/mulkcms2/benki/newsletter/NewsletterSender.java4
1 files changed, 4 insertions, 0 deletions
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 @@ public class NewsletterSender {
@ConfigProperty(name = "mulkcms.newsletter.time-zone")
ZoneId newsletterTimeZone;
+ @ConfigProperty(name = "quarkus.mailer.from")
+ String senderAddress;
+
@PersistenceContext EntityManager em;
@CheckedTemplate
@@ -100,6 +103,7 @@ public class NewsletterSender {
var sendJob =
mailText
.subject(String.format("MulkCMS newsletter #%d", newsletterNumber))
+ .to(senderAddress)
.bcc(subscriberEmails)
.send();
sendJob.toCompletableFuture().get(10000, TimeUnit.SECONDS);