# email Wysyłka maili przez SMTP z SiteIntegrations, w runtime (bez Payload email adaptera). Edytor zmienia SMTP w panelu — następny mail idzie z nowymi ustawieniami, bez restartu. ## Zależność ```json "dependencies": { "nodemailer": "^6.9.0" } ``` (+ `@types/nodemailer` w devDependencies) ## Config Brak opcji — SMTP (host, port, user, password, from) jest w SiteIntegrations (tab SMTP). Edytor konfiguruje w panelu. ## Front — sendEmail (server) ```ts import { sendEmail } from 'ipal-kit/server' const result = await sendEmail({ payload, to: 'kontakt@klient.pl', subject: 'Nowa wiadomość', html: '
Treść…
', // gotowy HTML (Twój wygląd) // text: 'wersja plain', from: '...', replyTo: '...' }) if (result.sent) { // result.messageId } else { // result.error — np. "SMTP is not configured..." } ``` - **HTML to Twój argument** — plugin nie ma templatek, wysyła to co podasz. Wygląd maila składasz na froncie. - Zwraca `{ sent: true, messageId }` albo `{ sent: false, error }` — nie rzuca wyjątku, nie wycieka detali SMTP do klienta. - Port 465 → implicit TLS, inne → STARTTLS. - `server-only` — hasło SMTP nigdy w bundlu przeglądarki. ## Uwaga: maile systemowe Payloada Reset hasła / weryfikacja email idą przez wbudowany mechanizm Payload (`config.email`), którego ten moduł **nie** konfiguruje (celowo — wymagałby SMTP w env). Jeśli ich potrzebujesz, to osobna konfiguracja adaptera przy `buildConfig`.