From 2df19ab3626eb4615e5808823749aaeea7372cbd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?= Date: Mon, 14 Nov 2022 09:17:52 +0100 Subject: [PATCH] Document testing options --- backend/src/emails/README.md | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/backend/src/emails/README.md b/backend/src/emails/README.md index 1f9433ed8..0c0fb41d9 100644 --- a/backend/src/emails/README.md +++ b/backend/src/emails/README.md @@ -24,3 +24,35 @@ The full `pug` documentation you'll find here: In case we are sending many emails in the future there is the possibility to cache the `pug` templates: - [cache-pug-templates](https://github.com/ladjs/cache-pug-templates) + +## Testing + +To test your send emails you have different possibilities: + +### In General + +To send emails to yourself while developing set in `.env` the value `EMAIL_TEST_MODUS=true` and `EMAIL_TEST_RECEIVER` to your preferred email address. + +### Unit Or Integration Tests + +To change the behavior to show previews etc. you have the following options to be set in `sendEmailTranslated.ts` on creating the email object: + +```js + const email = new Email({ + … + // send emails in development/test env: + send: true, + … + // to open send emails in the browser + preview: true, + // or + // to open send emails in a specific the browser + preview: { + open: { + app: 'firefox', + wait: false, + }, + }, + … + }) +```