feat: customer e-mails in the Site's look, and an order confirmation
All checks were successful
Build and deploy / Validate source (push) Successful in 49s
Build and deploy / Integration suite on a real stack (push) Successful in 3m23s
Build and deploy / Secret scan and release gate (push) Successful in 10s
Build and deploy / Publish images (push) Successful in 1m17s

The account e-mails (signup and e-mail change codes, new password, an
address that already has an account, the changed-e-mail notice) gain an
HTML version beside their plain text: the DROPSTAR header, a white card,
orange buttons, the customer greeted by first name. Built with tables and
inline styles only, so Gmail, Outlook and phone apps show it the same.

A paid order now also e-mails the customer "Recebemos seu pedido #N": the
items, delivery and total, the stages to come, and a link to the order in
the account. Not for an operator's test order. A code's or a recovery
link's HTML is erased with its text once sent. The team's alerts stay plain
text.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Cauê Faleiros
2026-10-19 09:18:20 -03:00
parent 5910d3161f
commit 3879754397
8 changed files with 359 additions and 42 deletions

View File

@@ -19,7 +19,7 @@ from psycopg.types.json import Jsonb
from . import mail
from .core.auth import audit
from .printjobs import queue as queue_print_files
from .runtime import enqueue, upload_row
from .runtime import PUBLIC_ORIGIN, enqueue, upload_row
from .scanning import require_clean
QUOTE_VALID_HOURS = 24
@@ -99,6 +99,7 @@ def create_order(c, quote, payment):
queue_print_files(c, order['id'], len(approved['items']))
if is_test(order):
return order, True
mail.order_paid(c, order, PUBLIC_ORIGIN)
enqueue(c, f"{order['id']}:paid:tiny", 'tiny',
{'order_id': str(order['id']), 'number': order['number'],
'event': 'payment_approved', 'order': approved})