Changeset 834bcc3 in Klonkt for src/config/mailer.js


Ignore:
Timestamp:
06/23/2026 06:14:27 PM (3 months ago)
Author:
Robin Genis <roboburr@…>
Branches:
main
Children:
d774679
Parents:
bb42dfb
Message:

i18n: translate Dutch code comments to English across src/

Comments in routes/services/views/config/middleware/assets translated to
English for the public repo. A few dev-facing throw/console message strings
were Englished too. No user-facing UI strings or i18n dictionary values changed
(src/services/i18n.js untouched). Logic unchanged.

Co-Authored-By: Claude <noreply@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/config/mailer.js

    rbb42dfb r834bcc3  
    1 // E-mail versturen (wachtwoord-reset, nieuwsbrief, notify). Optioneel: alleen actief
    2 // als SMTP is ingesteld — via Beheer → Instellingen (app_settings) OF env-vars.
     1// Send email (password reset, newsletter, notify). Optional: only active
     2// when SMTP is configured — via Admin → Settings (app_settings) OR env vars.
    33//
    4 // Config-bron (in deze volgorde): app_settings (ingesteld in de UI), anders env:
     4// Config source (in this order): app_settings (set via the UI), otherwise env:
    55//   SMTP_HOST, SMTP_PORT (default 587), SMTP_USER, SMTP_PASS, SMTP_FROM (default = USER)
    6 // Niet ingesteld → versturen valt terug op CLI (reset-admin) / wordt overgeslagen.
     6// Not configured → sending falls back to CLI (reset-admin) / is skipped.
    77
    88import nodemailer from 'nodemailer';
     
    2323}
    2424
    25 // Status voor de UI (zonder het wachtwoord te lekken).
     25// Status for the UI (without leaking the password).
    2626export function mailerStatus() {
    2727  const c = cfg();
     
    3333    from: c.from,
    3434    passSet: !!c.pass,
    35     // bron: handig om te tonen dat env nog actief is
     35    // source: useful to show that env vars are still active
    3636    fromEnv: !getSetting('smtp_host', '') && !!process.env.SMTP_HOST,
    3737  };
    3838}
    3939
    40 // Transport cachen, maar herbouwen zodra de config wijzigt (UI-edit zonder herstart).
     40// Cache the transport, but rebuild it whenever the config changes (UI edit without restart).
    4141let _transport = null, _key = null;
    4242function transport() {
     
    4747      host: c.host,
    4848      port: c.port,
    49       secure: c.port === 465, // 465 = impliciete TLS; 587 = STARTTLS
     49      secure: c.port === 465, // 465 = implicit TLS; 587 = STARTTLS
    5050      auth: { user: c.user, pass: c.pass },
    5151    });
     
    5656
    5757export async function sendMail({ to, subject, text, html }) {
    58   if (!mailerConfigured()) throw new Error('SMTP niet geconfigureerd');
     58  if (!mailerConfigured()) throw new Error('SMTP not configured');
    5959  const c = cfg();
    6060  return transport().sendMail({ from: c.from, to, subject, text, html });
Note: See TracChangeset for help on using the changeset viewer.