From ba3e58c04e918723233dcc66996399eeeff24007 Mon Sep 17 00:00:00 2001 From: Matthias Andreas Benkard Date: Sun, 1 Nov 2020 12:58:35 +0100 Subject: KB68 Implement newsletter sending. Change-Id: I1d56e40d7f35d6be77fde1a1e8519a91bd2dc3b8 --- src/main/resources/application.properties | 11 +++++ src/main/resources/db/changeLog-1.7.xml | 55 ++++++++++++++++++++++ src/main/resources/db/changeLog.xml | 1 + .../templates/NewsletterSender/newsletter.txt | 38 +++++++++++++++ 4 files changed, 105 insertions(+) create mode 100644 src/main/resources/db/changeLog-1.7.xml create mode 100644 src/main/resources/templates/NewsletterSender/newsletter.txt (limited to 'src/main/resources') diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index 3d56d21..b7c54da 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -9,6 +9,7 @@ quarkus.log.level = INFO mulkcms.tag-base = hub.benkard.de mulkcms.posts.default-max-results = 25 +mulkcms.newsletter.time-zone = Europe/Vienna quarkus.datasource.db-kind = postgresql quarkus.datasource.jdbc.driver = org.postgresql.Driver @@ -61,6 +62,13 @@ mulkcms.jwt.signing-key = MulkCMS-IdP mulkcms.jwt.issuer = https://matthias.benkard.de mulkcms.jwt.validity = P1D +# E-mail settings +quarkus.mailer.from = mulkcms@benkard.de +quarkus.mailer.host = mail.benkard.de +quarkus.mailer.port = 587 +quarkus.mailer.start-tls = REQUIRED +quarkus.mailer.username = mulkcms@benkard.de + # Deployment docker.registry = docker.benkard.de @@ -89,6 +97,9 @@ kubernetes.env-vars[0].value = database-password kubernetes.env-vars[1].name = QUARKUS_OIDC_CREDENTIALS_SECRET kubernetes.env-vars[1].secret = mulkcms2-secrets kubernetes.env-vars[1].value = keycloak-secret +kubernetes.env-vars[2].name = QUARKUS_MAILER_PASSWORD +kubernetes.env-vars[2].secret = mulkcms2-secrets +kubernetes.env-vars[2].value = email-password kubernetes.secret-volumes[0].volume-name = secrets kubernetes.secret-volumes[0].secret-name = mulkcms2-secrets kubernetes.secret-volumes[0].default-mode = 0444 diff --git a/src/main/resources/db/changeLog-1.7.xml b/src/main/resources/db/changeLog-1.7.xml new file mode 100644 index 0000000..8824115 --- /dev/null +++ b/src/main/resources/db/changeLog-1.7.xml @@ -0,0 +1,55 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/resources/db/changeLog.xml b/src/main/resources/db/changeLog.xml index f1c0849..7b4b700 100644 --- a/src/main/resources/db/changeLog.xml +++ b/src/main/resources/db/changeLog.xml @@ -13,5 +13,6 @@ + diff --git a/src/main/resources/templates/NewsletterSender/newsletter.txt b/src/main/resources/templates/NewsletterSender/newsletter.txt new file mode 100644 index 0000000..1c4228f --- /dev/null +++ b/src/main/resources/templates/NewsletterSender/newsletter.txt @@ -0,0 +1,38 @@ +{@int newsletterNumber} +{@java.time.LocalDate date} +{@java.util.List bookmarks} +{@java.util.List lazychatMessages} +{@java.lang.String unsubscribeUri} +New Blog Posts +============== + +{#for post in lazychatMessages} +* {post.date.humanDate} +{post.text.content} + + +{/for} + + +New Bookmarks +============= + +{#for post in bookmarks} +* {post.date.humanDate} +* {post.title} +* <{post.uri}> + +{post.text.description} + + +{/for} + + + +Your Subscription +================= + +You are receiving this email because you are subscribed to the MulkCMS +newsletter. To unsubscribe, send an email to: + + -- cgit v1.2.3