diff options
Diffstat (limited to 'backend/src/email.js')
| -rw-r--r-- | backend/src/email.js | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/backend/src/email.js b/backend/src/email.js new file mode 100644 index 0000000..b41bae5 --- /dev/null +++ b/backend/src/email.js @@ -0,0 +1,20 @@ +const consoleBackend = { + send: ({ recipients, subject, body, cc, bcc }) => { + if (!recipients) throw new Exception('Recipients missing'); + if (!subject) throw new Exception('Subject missing'); + + console.log('Email sent to console.'); + console.log('=== To:', recipients.join(', ')); + if (cc) console.log('=== CC:', cc.join(', ')); + if (bcc) console.log('=== BCC:', bcc.join(', ')); + console.log('=== Subject:', subject); + console.log(); + console.log('=== Body:'); + console.log(body); + console.log('==='); + }, +}; + +module.exports = { + consoleBackend, +}; |
