diff --git a/.github/workflows/dockerImage.yml b/.github/workflows/dockerImage.yml index b8f30a8..363f4d8 100644 --- a/.github/workflows/dockerImage.yml +++ b/.github/workflows/dockerImage.yml @@ -45,11 +45,16 @@ jobs: uses: actions/download-artifact@v2 with: name: targetfiles + - name: Prepare Docker variables + run: | + echo "DOCKER_REGISTRY=$(echo "docker.pkg.github.com/${{ github.repository }}" | awk '{print tolower($0)}')" >> $GITHUB_ENV + echo "DOCKER_IMAGE=$(echo "${{ github.repository }}" | awk -F / '{print tolower($2)}')" >> $GITHUB_ENV + shell: bash - name: Push to GitHub Packages uses: docker/build-push-action@v1.1.1 with: username: ${{ secrets.GH_PACKAGE_RELEASE_USER }} password: ${{ secrets.GH_PACKAGE_RELEASE_TOKEN }} - registry: docker.pkg.github.com - repository: caritasdeutschland/caritas-onlineberatung-mailservice/mailservice-image + registry: ${{ env.DOCKER_REGISTRY }} + repository: ${{ env.DOCKER_IMAGE }} tag_with_ref: true diff --git a/.gitignore b/.gitignore index 55d4109..7bb4338 100644 --- a/.gitignore +++ b/.gitignore @@ -26,3 +26,6 @@ /.nb-gradle/ wrapper log + +### Mac ### +*.DS_Store diff --git a/pom.xml b/pom.xml index dbe5f78..2938126 100644 --- a/pom.xml +++ b/pom.xml @@ -48,6 +48,12 @@ openapi-generator-maven-plugin 5.1.1 provided + + + javax.mail + mailapi + + org.openapitools @@ -105,6 +111,11 @@ commons-text 1.9 + + commons-io + commons-io + 2.6 + @@ -180,6 +191,9 @@ true / + + javax.mail:mailapi:1.4.3 + ${project.basedir}/api/mailservice.yaml spring diff --git a/src/main/java/de/caritas/cob/mailservice/api/service/ExchangeMailService.java b/src/main/java/de/caritas/cob/mailservice/api/service/ExchangeMailService.java index f4f4574..7ebc7da 100644 --- a/src/main/java/de/caritas/cob/mailservice/api/service/ExchangeMailService.java +++ b/src/main/java/de/caritas/cob/mailservice/api/service/ExchangeMailService.java @@ -5,7 +5,6 @@ import de.caritas.cob.mailservice.api.exception.ExchangeMailServiceException; import de.caritas.cob.mailservice.api.mailtemplate.TemplateImage; -import java.io.InputStream; import java.net.URI; import java.net.URISyntaxException; import java.util.List; @@ -26,6 +25,8 @@ public class ExchangeMailService { private static final String TEMPLATE_IMAGE_DIR = "/templates/images/"; + private static final String CUSTOM_TEMPLATE_IMAGE_DIR = "images/"; + @Value("${mail.sender}") private String mailSender; @@ -45,11 +46,17 @@ public class ExchangeMailService { @Value("${mail.exchange.version}") String exchangeVersion; + @Value("${template.custom.resources.path}") + private String customResourcePath; + + @Value("${template.use.custom.resources.path}") + private boolean useCustomResourcesPath; + /** * Preparing and sending an html mail via Exchange. * - * @param recipient The mail address of the recipient - * @param subject The subject of the mail + * @param recipient The mail address of the recipient + * @param subject The subject of the mail * @param htmlTemplate The name of the html template */ public void prepareAndSendHtmlMail(String recipient, String subject, String htmlTemplate, @@ -61,8 +68,8 @@ public void prepareAndSendHtmlMail(String recipient, String subject, String html * Preparing and sending an text mail via Exchange. * * @param recipients The mail address of the recipients - * @param subject The subject of the mail - * @param body The text to send + * @param subject The subject of the mail + * @param body The text to send */ public void prepareAndSendTextMail(String recipients, String subject, String body) throws ExchangeMailServiceException { @@ -76,7 +83,7 @@ private void prepareAndSendMail(String recipients, String subject, String bodyTe throw new ExchangeMailServiceException("No sender mail address set"); } - ExchangeService exchangeService = new ExchangeService(ExchangeVersion.valueOf(exchangeVersion)); + var exchangeService = new ExchangeService(ExchangeVersion.valueOf(exchangeVersion)); setupExchangeService(exchangeService); EmailMessage msg = buildEmailMessage(subject, bodyText, bodyType, exchangeService); addEmailAttachmentsIfNecessary(templateImages, msg); @@ -110,10 +117,10 @@ private void setupExchangeService(ExchangeService exchangeService) private EmailMessage buildEmailMessage(String subject, String bodyText, BodyType bodyType, ExchangeService exchangeService) throws ExchangeMailServiceException { try { - EmailMessage msg = new EmailMessage(exchangeService); + var msg = new EmailMessage(exchangeService); msg.setSubject(subject); - MessageBody messageBody = new MessageBody(); + var messageBody = new MessageBody(); messageBody.setBodyType(bodyType); messageBody.setText(bodyText); msg.setBody(messageBody); @@ -126,22 +133,27 @@ private EmailMessage buildEmailMessage(String subject, String bodyText, BodyType private void addEmailAttachmentsIfNecessary(List templateImages, EmailMessage msg) throws ExchangeMailServiceException { if (!CollectionUtils.isEmpty(templateImages)) { - try { - int attachmentIndex = 0; - for (TemplateImage templateImage : templateImages) { - InputStream inputStream = - getClass().getResourceAsStream(TEMPLATE_IMAGE_DIR + templateImage.getFilename()); + + int attachmentIndex = 0; + for (TemplateImage templateImage : templateImages) { + try { + var inputStream = + useCustomResourcesPath ? getClass().getResourceAsStream( + customResourcePath + CUSTOM_TEMPLATE_IMAGE_DIR + templateImage.getFilename()) + : getClass() + .getResourceAsStream(TEMPLATE_IMAGE_DIR + templateImage.getFilename()); msg.getAttachments().addFileAttachment(templateImage.getFilename(), inputStream); msg.getAttachments().getItems().get(attachmentIndex).setIsInline(true); msg.getAttachments().getItems().get(attachmentIndex) .setContentId(templateImage.getFilename()); - msg.getAttachments().getItems().get(attachmentIndex).setName(templateImage.getFilename()); + msg.getAttachments().getItems().get(attachmentIndex) + .setName(templateImage.getFilename()); msg.getAttachments().getItems().get(attachmentIndex) .setContentType(templateImage.getFiletype()); attachmentIndex++; + } catch (Exception e) { + throw new ExchangeMailServiceException("Error while processing attachments", e); } - } catch (Exception e) { - throw new ExchangeMailServiceException("Error while processing attachments", e); } } } diff --git a/src/main/java/de/caritas/cob/mailservice/api/service/MailService.java b/src/main/java/de/caritas/cob/mailservice/api/service/MailService.java index 1e08e95..ce34fa5 100644 --- a/src/main/java/de/caritas/cob/mailservice/api/service/MailService.java +++ b/src/main/java/de/caritas/cob/mailservice/api/service/MailService.java @@ -1,7 +1,6 @@ package de.caritas.cob.mailservice.api.service; import static java.util.Objects.nonNull; -import static org.apache.commons.lang3.exception.ExceptionUtils.getStackTrace; import de.caritas.cob.mailservice.api.exception.ExchangeMailServiceException; import de.caritas.cob.mailservice.api.exception.InternalServerErrorException; @@ -181,4 +180,4 @@ private void loadUnescapedMailDataAndSendMail(MailDTO mail, } -} +} \ No newline at end of file diff --git a/src/main/java/de/caritas/cob/mailservice/api/service/SmtpMailService.java b/src/main/java/de/caritas/cob/mailservice/api/service/SmtpMailService.java index 6a0b968..f5ab0ec 100644 --- a/src/main/java/de/caritas/cob/mailservice/api/service/SmtpMailService.java +++ b/src/main/java/de/caritas/cob/mailservice/api/service/SmtpMailService.java @@ -1,13 +1,18 @@ package de.caritas.cob.mailservice.api.service; +import static java.util.Objects.isNull; import static org.apache.commons.lang3.StringUtils.isNotBlank; import de.caritas.cob.mailservice.api.exception.SmtpMailServiceException; import de.caritas.cob.mailservice.api.mailtemplate.TemplateImage; +import java.io.FileInputStream; import java.util.List; +import org.apache.commons.io.IOUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; +import org.springframework.core.io.ByteArrayResource; import org.springframework.core.io.ClassPathResource; +import org.springframework.core.io.InputStreamSource; import org.springframework.mail.MailException; import org.springframework.mail.javamail.JavaMailSender; import org.springframework.mail.javamail.MimeMessageHelper; @@ -22,8 +27,9 @@ public class SmtpMailService { private static final String TEMPLATE_IMAGE_DIR = "/templates/images/"; + private static final String CUSTOM_TEMPLATE_IMAGE_DIR = "images/"; - private JavaMailSender javaMailSender; + private final JavaMailSender javaMailSender; @Value("${mail.sender}") private String mailSender; @@ -31,6 +37,12 @@ public class SmtpMailService { @Value("${mail.fix.recipient}") private String fixMailRecipient; + @Value("${template.custom.resources.path}") + private String customResourcePath; + + @Value("${template.use.custom.resources.path}") + private boolean useCustomResourcesPath; + /** * Standard constructor for mail service */ @@ -42,14 +54,14 @@ public SmtpMailService(JavaMailSender javaMailSender) { /** * Preparing and sending an html mail via smtp. * - * @param recipient The mail address of the recipient - * @param subject The subject of the mail + * @param recipient The mail address of the recipient + * @param subject The subject of the mail * @param htmlTemplate The name of the html template */ public void prepareAndSendHtmlMail(String recipient, String subject, String htmlTemplate, List templateImages) throws SmtpMailServiceException { - if (mailSender == null) { + if (isNull(mailSender)) { throw new SmtpMailServiceException("No sender mail address set"); } @@ -65,21 +77,27 @@ public void prepareAndSendHtmlMail(String recipient, String subject, String html private MimeMessagePreparator buildHtmlMessagePreparator(String recipient, String subject, String htmlTemplate, List templateImages) { return mimeMessage -> { - MimeMessageHelper messageHelper = new MimeMessageHelper(mimeMessage, + var messageHelper = new MimeMessageHelper(mimeMessage, (!CollectionUtils.isEmpty(templateImages)), "UTF-8"); messageHelper.setFrom(this.mailSender); - if (isNotBlank(fixMailRecipient)) { - messageHelper.setTo(fixMailRecipient); - } else { - messageHelper.setTo(recipient); - } + messageHelper.setTo(getRecipients(recipient)); messageHelper.setSubject(subject); messageHelper.setText(htmlTemplate, true); if (!CollectionUtils.isEmpty(templateImages)) { for (TemplateImage templateImage : templateImages) { - messageHelper.addInline(templateImage.getFilename(), - new ClassPathResource(TEMPLATE_IMAGE_DIR + templateImage.getFilename()), + InputStreamSource inputStreamSource; + if (useCustomResourcesPath) { + inputStreamSource = new ByteArrayResource( + IOUtils.toByteArray(new FileInputStream( + customResourcePath + CUSTOM_TEMPLATE_IMAGE_DIR + templateImage + .getFilename()))); + } else { + inputStreamSource = new ClassPathResource( + TEMPLATE_IMAGE_DIR + templateImage + .getFilename()); + } + messageHelper.addInline(templateImage.getFilename(), inputStreamSource, templateImage.getFiletype()); } } @@ -90,8 +108,8 @@ private MimeMessagePreparator buildHtmlMessagePreparator(String recipient, Strin * Preparing and sending an simple text mail. * * @param recipient The mail address of the recipient - * @param subject The subject of the mail - * @param body The body of the mail + * @param subject The subject of the mail + * @param body The body of the mail */ public void prepareAndSendTextMail(String recipient, String subject, String body) throws SmtpMailServiceException { @@ -111,17 +129,19 @@ private MimeMessagePreparator buildTextMessagePreparator(String recipient, Strin String body) { return mimeMessage -> { - MimeMessageHelper messageHelper = new MimeMessageHelper(mimeMessage); + var messageHelper = new MimeMessageHelper(mimeMessage); messageHelper.setFrom(this.mailSender); - if (isNotBlank(fixMailRecipient)) { - messageHelper.setTo(fixMailRecipient); - } else { - String[] recipients = recipient.split(","); - messageHelper.setTo(recipients); - } + messageHelper.setTo(getRecipients(recipient)); messageHelper.setSubject(subject); messageHelper.setText(body, false); }; } + private String[] getRecipients(String recipient) { + if (isNotBlank(fixMailRecipient)) { + return new String[] { fixMailRecipient }; + } else { + return recipient.split(","); + } + } } diff --git a/src/main/java/de/caritas/cob/mailservice/api/service/TemplateDescriptionService.java b/src/main/java/de/caritas/cob/mailservice/api/service/TemplateDescriptionService.java index 9df02bf..1ee77d0 100644 --- a/src/main/java/de/caritas/cob/mailservice/api/service/TemplateDescriptionService.java +++ b/src/main/java/de/caritas/cob/mailservice/api/service/TemplateDescriptionService.java @@ -3,12 +3,11 @@ import com.fasterxml.jackson.databind.ObjectMapper; import de.caritas.cob.mailservice.api.exception.TemplateDescriptionServiceException; import de.caritas.cob.mailservice.api.mailtemplate.TemplateDescription; -import java.io.InputStream; import java.nio.charset.StandardCharsets; import java.util.List; import java.util.Optional; -import java.util.stream.Collectors; import org.apache.commons.io.IOUtils; +import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; /** @@ -20,9 +19,15 @@ public class TemplateDescriptionService { private static final String TEMPLATE_DIR = "/templates/"; private static final String TEMPLATE_EXTENSION = ".json"; + @Value("${template.use.custom.resources.path}") + private boolean useCustomResourcesPath; + + @Value("${template.custom.resources.path}") + private String customResourcePath; + /** * Returns an instance of a mail template object - * + * * @param templateName the name of the mail template * @return the mail template object */ @@ -35,38 +40,38 @@ public Optional getTemplateDescription(String templateName) /** * Load template description - * + * * @param templateName the template name * @return the template description */ private TemplateDescription loadTemplateDescription(String templateName) throws TemplateDescriptionServiceException { - ObjectMapper mapper = new ObjectMapper(); - TemplateDescription templateDescription = null; + var mapper = new ObjectMapper(); String templateDescriptionJson = loadTemplateDescriptionFile(templateName); try { - templateDescription = mapper.readValue(templateDescriptionJson, TemplateDescription.class); + return mapper.readValue(templateDescriptionJson, TemplateDescription.class); } catch (Exception ex) { throw new TemplateDescriptionServiceException(String.format( "Json file with template description could not be parsed, template name: %s", templateName), ex); } - return templateDescription; } /** * Load template file from resources. InputStream is needed as file is located in jar. - * - * @param templateName + * + * @param templateName the name of the template * @return the content of the template description file */ private String loadTemplateDescriptionFile(String templateName) throws TemplateDescriptionServiceException { - InputStream in = - TemplateDescriptionService.class.getResourceAsStream(getTemplateFilename(templateName)); - try { - final List fileLines = IOUtils.readLines(in, StandardCharsets.UTF_8.displayName()); + var inputStream = useCustomResourcesPath ? TemplateDescriptionService.class + .getResourceAsStream(customResourcePath + templateName.toLowerCase() + TEMPLATE_EXTENSION) + : TemplateDescriptionService.class.getResourceAsStream(getTemplateFilename(templateName)); + assert inputStream != null; + final List fileLines = IOUtils + .readLines(inputStream, StandardCharsets.UTF_8.displayName()); return String.join("", fileLines); } catch (Exception ex) { throw new TemplateDescriptionServiceException(String.format( @@ -77,7 +82,7 @@ private String loadTemplateDescriptionFile(String templateName) /** * Get the filename and filepath for the template description file - * + * * @param templateName the template name * @return the filename with filepath of the template description file */ diff --git a/src/main/java/de/caritas/cob/mailservice/config/ThymeleafConfig.java b/src/main/java/de/caritas/cob/mailservice/config/ThymeleafConfig.java index 5aab758..c410890 100644 --- a/src/main/java/de/caritas/cob/mailservice/config/ThymeleafConfig.java +++ b/src/main/java/de/caritas/cob/mailservice/config/ThymeleafConfig.java @@ -1,28 +1,53 @@ package de.caritas.cob.mailservice.config; import java.nio.charset.StandardCharsets; +import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.thymeleaf.templatemode.TemplateMode; import org.thymeleaf.templateresolver.ClassLoaderTemplateResolver; +import org.thymeleaf.templateresolver.FileTemplateResolver; +import org.thymeleaf.templateresolver.ITemplateResolver; @Configuration public class ThymeleafConfig { + @Value("${template.custom.resources.path}") + private String customResourcePath; + + @Value("${template.use.custom.resources.path}") + private boolean useCustomResourcesPath; + /** - * This method is use to get ClassLoaderTemplateResolver. + * Based on the {@link ThymeleafConfig#useCustomResourcesPath} value this method creates the right template resolver. + * useCustomResourcesPath == true -> {@link ThymeleafConfig#htmlFileTemplateResolver()} + * useCustomResourcesPath == true -> {@link ThymeleafConfig#htmlClassLoaderTemplateResolver()} * * @return ClassLoaderTemplateResolver. */ - @Bean - public ClassLoaderTemplateResolver htmlTemplateResolver() { - ClassLoaderTemplateResolver emailTemplateResolver = new ClassLoaderTemplateResolver(); - emailTemplateResolver.setPrefix("/templates/"); - emailTemplateResolver.setSuffix(".html"); - emailTemplateResolver.setTemplateMode(TemplateMode.HTML); - emailTemplateResolver.setCharacterEncoding(StandardCharsets.UTF_8.name()); - return emailTemplateResolver; + public ITemplateResolver templateResolver() { + return useCustomResourcesPath ? htmlFileTemplateResolver() : htmlClassLoaderTemplateResolver(); + } + + private ITemplateResolver htmlFileTemplateResolver() { + FileTemplateResolver emailFileTemplateResolver = new FileTemplateResolver(); + emailFileTemplateResolver.setOrder(1); + emailFileTemplateResolver.setPrefix(customResourcePath); + emailFileTemplateResolver.setSuffix(".html"); + emailFileTemplateResolver.setTemplateMode(TemplateMode.HTML); + emailFileTemplateResolver.setCharacterEncoding(StandardCharsets.UTF_8.name()); + return emailFileTemplateResolver; + } + + private ITemplateResolver htmlClassLoaderTemplateResolver() { + ClassLoaderTemplateResolver emailClassLoaderTemplateResolver = new ClassLoaderTemplateResolver(); + emailClassLoaderTemplateResolver.setOrder(2); + emailClassLoaderTemplateResolver.setPrefix("/templates/"); + emailClassLoaderTemplateResolver.setSuffix(".html"); + emailClassLoaderTemplateResolver.setTemplateMode(TemplateMode.HTML); + emailClassLoaderTemplateResolver.setCharacterEncoding(StandardCharsets.UTF_8.name()); + return emailClassLoaderTemplateResolver; } } diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index 074a2a8..da0b10c 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -58,3 +58,7 @@ mail.error.recipients=eberl@open4business.de # CSRF token csrf.header.property= csrf.cookie.property= + +# refactoring +template.use.custom.resources.path= +template.custom.resources.path= diff --git a/templates/assign-enquiry-notification.html b/templates/assign-enquiry-notification.html new file mode 100644 index 0000000..02b18a4 --- /dev/null +++ b/templates/assign-enquiry-notification.html @@ -0,0 +1,81 @@ + + + + + + + +
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+ + + +

Beratung & Hilfe

+
Online. Anonym. Sicher.
+
+ +
+ +
+
+ Liebe(r) , +

+ hat dir als neuen Ratsuchenden zugewiesen. +
+
+ + + +
+
+ + + + + +
+
+ Impressum +   |   + Datenschutz +
+
+
+ + \ No newline at end of file diff --git a/templates/assign-enquiry-notification.json b/templates/assign-enquiry-notification.json new file mode 100644 index 0000000..ac62c19 --- /dev/null +++ b/templates/assign-enquiry-notification.json @@ -0,0 +1,25 @@ +{ + "htmlTemplateFilename":"assign-enquiry-notification.html", + "subject":"Neue_r Ratsuchende_r", + "templateImages" : [ + { + "filename":"logo.png", + "filetype":"image/png" + }, + { + "filename":"illustration-bottom.png", + "filetype":"image/png" + }, + { + "filename":"illustration-top.png", + "filetype":"image/png" + } + ], + "templateDataFields": + [ + "name_recipient", + "name_sender", + "name_user", + "url" + ] +} \ No newline at end of file diff --git a/templates/enquiry-notification-consultant.html b/templates/enquiry-notification-consultant.html new file mode 100644 index 0000000..abcb788 --- /dev/null +++ b/templates/enquiry-notification-consultant.html @@ -0,0 +1,85 @@ + + + + + + + +
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+ + + +

Beratung & Hilfe

+
Online. Anonym. Sicher.
+
+ +
+ +
+
+ Liebe(r) , +

+ in der Beratungsstelle ist eine neue Erstanfrage eingegangen. +

+ Liebe Grüße +
+ Ihr Diakonie Team +
+
+ + + +
+
+ + + + + +
+
+ Impressum +   |   + Datenschutz +
+
+
+ + \ No newline at end of file diff --git a/templates/enquiry-notification-consultant.json b/templates/enquiry-notification-consultant.json new file mode 100644 index 0000000..a739956 --- /dev/null +++ b/templates/enquiry-notification-consultant.json @@ -0,0 +1,25 @@ +{ + "htmlTemplateFilename":"enquiry-notification-consultant.html", + "subject":"Neue Erstanfrage [PLZ: ${plz}]", + "templateImages" : [ + { + "filename":"logo.png", + "filetype":"image/png" + }, + { + "filename":"illustration-bottom.png", + "filetype":"image/png" + }, + { + "filename":"illustration-top.png", + "filetype":"image/png" + } + ], + "templateDataFields": + [ + "beratungsstelle", + "plz", + "url", + "name" + ] +} \ No newline at end of file diff --git a/templates/feedback-message-notification.html b/templates/feedback-message-notification.html new file mode 100644 index 0000000..53a4d72 --- /dev/null +++ b/templates/feedback-message-notification.html @@ -0,0 +1,81 @@ + + + + + + + +
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+ + + +

Beratung & Hilfe

+
Online. Anonym. Sicher.
+
+ +
+ +
+
+ Liebe(r) ,
+
+ hat eine Feedback-Nachricht für die Beratung von hinterlassen. +
+
+ + + +
+
+ + + + + +
+
+ Impressum +   |   + Datenschutz +
+
+
+ + \ No newline at end of file diff --git a/templates/feedback-message-notification.json b/templates/feedback-message-notification.json new file mode 100644 index 0000000..95933f6 --- /dev/null +++ b/templates/feedback-message-notification.json @@ -0,0 +1,25 @@ +{ + "htmlTemplateFilename":"feedback-message-notification.html", + "subject":"Neue Feedback-Nachricht", + "templateImages" : [ + { + "filename":"logo.png", + "filetype":"image/png" + }, + { + "filename":"illustration-bottom.png", + "filetype":"image/png" + }, + { + "filename":"illustration-top.png", + "filetype":"image/png" + } + ], + "templateDataFields": + [ + "name_sender", + "name_recipient", + "name_user", + "url" + ] +} \ No newline at end of file diff --git a/templates/free-text.html b/templates/free-text.html new file mode 100644 index 0000000..1b2a5c2 --- /dev/null +++ b/templates/free-text.html @@ -0,0 +1,73 @@ + + + + + + + +
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+ + + +

Beratung & Hilfe

+
Online. Anonym. Sicher.
+
+ +
+ +
+
+
+ [(${text})] +
+
+
+
+ + + + + +
+
+ Impressum +   |   + Datenschutz +
+
+
+ + diff --git a/templates/free-text.json b/templates/free-text.json new file mode 100644 index 0000000..dcf16cc --- /dev/null +++ b/templates/free-text.json @@ -0,0 +1,24 @@ +{ + "htmlTemplateFilename":"free-text.html", + "subject":"${subject}", + "templateImages" : [ + { + "filename":"logo.png", + "filetype":"image/png" + }, + { + "filename":"illustration-bottom.png", + "filetype":"image/png" + }, + { + "filename":"illustration-top.png", + "filetype":"image/png" + } + ], + "templateDataFields": + [ + "subject", + "text", + "url" + ] +} \ No newline at end of file diff --git a/templates/images/illustration-bottom.png b/templates/images/illustration-bottom.png new file mode 100644 index 0000000..8bbf892 Binary files /dev/null and b/templates/images/illustration-bottom.png differ diff --git a/templates/images/illustration-top.png b/templates/images/illustration-top.png new file mode 100644 index 0000000..824cd22 Binary files /dev/null and b/templates/images/illustration-top.png differ diff --git a/templates/images/logo.png b/templates/images/logo.png new file mode 100644 index 0000000..e5ded1e Binary files /dev/null and b/templates/images/logo.png differ diff --git a/templates/message-notification-asker.html b/templates/message-notification-asker.html new file mode 100644 index 0000000..f9c8836 --- /dev/null +++ b/templates/message-notification-asker.html @@ -0,0 +1,87 @@ + + + + + + + +
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+ + + +

Beratung & Hilfe

+
Online. Anonym. Sicher.
+
+ +
+ +
+
+ Liebe(r) ,
+
+ Sie haben eine Antwort von erhalten.
+
+ Bitte melden Sie sich an, um Ihre Antwort zu lesen!
+
+
+ Liebe Grüße
+ Ihr Diakonie Team
+
+
+ + + +
+
+ + + + + +
+
+ Impressum +   |   + Datenschutz +
+
+
+ + \ No newline at end of file diff --git a/templates/message-notification-asker.json b/templates/message-notification-asker.json new file mode 100644 index 0000000..210561d --- /dev/null +++ b/templates/message-notification-asker.json @@ -0,0 +1,24 @@ +{ + "htmlTemplateFilename":"message-notification-asker.html", + "subject":"Antwort von ${consultantName}", + "templateImages" : [ + { + "filename":"logo.png", + "filetype":"image/png" + }, + { + "filename":"illustration-bottom.png", + "filetype":"image/png" + }, + { + "filename":"illustration-top.png", + "filetype":"image/png" + } + ], + "templateDataFields": + [ + "consultantName", + "askerName", + "url" + ] +} \ No newline at end of file diff --git a/templates/message-notification-consultant.html b/templates/message-notification-consultant.html new file mode 100644 index 0000000..1e1e9d1 --- /dev/null +++ b/templates/message-notification-consultant.html @@ -0,0 +1,81 @@ + + + + + + + +
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+ + + +

Beratung & Hilfe

+
Online. Anonym. Sicher.
+
+ +
+ +
+
+ Liebe(r) ,
+
+ Sie haben eine neue Nachricht in Ihren Beratungen. +
+
+ + + +
+
+ + + + + +
+
+ Impressum +   |   + Datenschutz +
+
+
+ + \ No newline at end of file diff --git a/templates/message-notification-consultant.json b/templates/message-notification-consultant.json new file mode 100644 index 0000000..0ab4e0c --- /dev/null +++ b/templates/message-notification-consultant.json @@ -0,0 +1,24 @@ +{ + "htmlTemplateFilename":"message-notification-consultant.html", + "subject":"Neue Nachricht [PLZ: ${plz}]", + "templateImages" : [ + { + "filename":"logo.png", + "filetype":"image/png" + }, + { + "filename":"illustration-bottom.png", + "filetype":"image/png" + }, + { + "filename":"illustration-top.png", + "filetype":"image/png" + } + ], + "templateDataFields": + [ + "plz", + "url", + "name" + ] +} \ No newline at end of file