Email Notifications
PicPeak sends automated emails for gallery lifecycle events using a queue-based processor with retry logic.
Email types
- Gallery creation --- sent to the customer with the gallery link and optional password.
- Expiration warning --- sent before a gallery expires.
- Gallery link resend --- manually triggered from the admin panel or API.
SMTP configuration
Configure your SMTP provider in .env:
SMTP_HOST=smtp.gmail.com
SMTP_PORT=587
SMTP_SECURE=false
[email protected]
SMTP_PASS=your-app-specific-password
[email protected]For Gmail, use an app-specific password . Regular account passwords will not work.
SendGrid example
SMTP_HOST=smtp.sendgrid.net
SMTP_PORT=587
SMTP_SECURE=false
SMTP_USER=apikey
SMTP_PASS=your-sendgrid-api-keyMail servers on a private network
PicPeak refuses to connect over SMTP or IMAP to a host that resolves to a private, loopback or other internal address, and it checks the DNS answer each time it opens a connection. To use a mail server on your own network (a relay in the same Compose stack, MailHog, a NAS), approve it in the deployment environment:
MAIL_PRIVATE_ENDPOINTS=smtp://mailrelay:25,imap://mail.lan:993Each entry is one protocol, host and explicit port, with no credentials or path; entries are comma-separated, and a malformed entry approves nothing and is logged. The server named by SMTP_HOST / SMTP_PORT in the environment is approved without an entry. Cloud metadata and link-local addresses stay refused even when listed. A refused connection fails the test or send with a mail network policy error. See Environment Variables.
On both channels: beta from v3.167.2-beta.0, stable from v3.134.2.
Webhook transport instead of SMTP
PicPeak can hand every outgoing message to a webhook rather than sending it itself, which suits an n8n / Make / self-hosted relay setup.
It is configured in the environment, not in the admin interface:
| Variable | Required | Notes |
|---|---|---|
EMAIL_WEBHOOK_URL | yes | https:// only. Setting it switches the transport on. |
EMAIL_WEBHOOK_SECRET | yes | Without it the transport stays off and logs why. |
EMAIL_FROM | yes | A webhook-only install has no SMTP row to take the sender from. |
EMAIL_WEBHOOK_ALLOW_PRIVATE_URLS | no | Needed to target a private or container address, which is otherwise refused. |
Each message is POSTed as JSON with from, to, cc, subject, html, text and attachments, where every attachment carries its filename, content type and base64 content. The raw body is signed with HMAC-SHA256 in the X-PicPeak-Signature header, the same scheme as gallery webhooks, so verify it the same way. Custom headers are not configurable.
Requests time out after 15 seconds, and any non-2xx response or transport error leaves the message in the queue to be retried. Attachments above 10 MB fail rather than being truncated. Send test email works and reports webhook-specific errors instead of SMTP advice.
Per-account SMTP hosts configured under Settings → Mail accounts keep sending over their own SMTP.
Mail server passwords
The SMTP, IMAP and mail-account forms send the stored password back masked (********), so you do not retype it for every edit. In builds containing PicPeak PR #1485 , the masked password is only reused for the same server:
- Changing a server’s host, port, username or encryption (TLS) requires entering its password again. Saving or testing without it fails with a “password required” error.
- Editing anything else — sender name, folder, polling on or off — keeps the stored password as before.
- Test connection and folder detection for IMAP, and the mail-account test, need the
email.editpermission.
Invitation and password-reset emails
Admin invitations, customer invitations and customer password-reset emails contain a link that sets the account’s password. Once such an email has been sent, the link is masked in the Messages archive, and the email cannot be resent, retried or sent again from there. To give someone a working link, send a new invitation or password reset. (Builds containing PicPeak PR #1485 .)
Multilingual templates
Email templates support multiple languages. PicPeak includes English and German templates out of the box. The template language is selected based on event or system settings.
Template editor
Edit email templates from the admin panel. The editor provides:
- HTML template editing with variable placeholders.
- Live preview of the rendered email.
- Test email sending to verify formatting.
The email wrapper function (wrapEmailHtml()) in emailProcessor.js applies consistent styling and layout to all outgoing emails.
Email accent colour
The header bar, headings, buttons and links use the Primary Color set under Settings → Email. On the beta channel (from v3.168.0-beta.0), when that field is empty the accent follows the filled accent from Branding → Colours, as long as it has at least 3:1 contrast against the white email card; a paler brand colour, or none, keeps the original green. The green that the built-in templates carry inline is replaced by the same accent, darkened where needed so links stay readable. When the accent comes from Branding and Button text is empty, the button label colour is chosen to read on it. Newsletters, test mails and other hand-written bodies keep their own colours.
Email queue
Emails are processed through a queue with automatic retry on failure. Monitor the email queue status from the admin panel or by checking the backend logs:
docker compose logs backend | grep emailLogo in emails
Email logos use the FRONTEND_URL value to construct the image URL. Make sure this is set to your publicly accessible domain so email recipients can see images correctly.
If API_URL is set, it is used for email asset URLs. Otherwise it defaults to http://localhost:3001, which will result in broken images for external recipients.