From 1dcac65bcbf53aa77f4f8f924433363e5d2cfde3 Mon Sep 17 00:00:00 2001 From: David Thyresson Date: Tue, 5 Dec 2023 16:47:12 -0500 Subject: [PATCH] chore: Update Testing documentation to link to How to Test Email/Mailer (#9634) The testing docs include info on how to test service, directives, cells, and more ... but did not link to the "how to test email" with the recent Redwood Mailer package. This PR adds some short comy introducing the topic and a link to the main Mailer testing section. --- docs/docs/testing.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/docs/docs/testing.md b/docs/docs/testing.md index 23b4a2afc340..12ee3579ad08 100644 --- a/docs/docs/testing.md +++ b/docs/docs/testing.md @@ -1975,6 +1975,16 @@ console.log(testCacheClient.storage) This is mainly helpful when you are testing for a very specific value, or have edgecases in how the serialization/deserialization works in the cache. +## Testing Mailer + +If your project uses [RedwoodJS Mailer](./mailer.md) to send emails, you can [also write tests](./mailer.md#testing) to make sure that email: + +* is sent to an sandbox inbox +* renders properly +* sets the expected to, from, cc, bcc, subject attributes based on the email sending logic +* checks that the html and text content is set correctly + +Since these tests send mail to a sandbox inbox, you can be confident that no emails accidentally get sent into the wild as part of your test or CI runs. ## Wrapping Up