diff --git a/plugins/printedparts/api/routes.py b/plugins/printedparts/api/routes.py index ba48c12..f55a983 100644 --- a/plugins/printedparts/api/routes.py +++ b/plugins/printedparts/api/routes.py @@ -330,13 +330,20 @@ def _send_lowstock_alert(item): Recipients: Setting printedparts_alert_email (comma-separated), falling back to the site's alert_recipients. Never fails the transaction - the ledger write already committed.""" - from shopdb.api import send_email, send_alert - subject = (f'Low stock: {item.itemname} ({item.itemcode}) - ' + from shopdb.api import send_email, send_alert, Setting + code = item.gagelabtag or item.itemcode + subject = (f'Low stock: {item.itemname} ({code}) - ' f'{item.quantityonhand} left') - html = (f'
{item.itemname} ({item.itemcode}) is down '
+ # Absolute link to the item page when the site base URL is configured
+ # (e.g. https:// {item.itemname} ({code}) is down '
f'to {item.quantityonhand} '
f'(threshold {item.lowstockthreshold}). Bin: {item.binlocation or "-"} Time to print more. {{ item.gagelabtag || item.itemcode }} - {{ item.quantityonhand }} on hand Revision {{ scannedRevision }} Scan your badge or tap in your SSO {{ item.quantityonhand }} on hand Revision {{ scannedRevision }} How many are you taking? Done - {{ doneMessage }} Checked out revision {{ scannedRevision }} Starting over in a few seconds...{{ item.itemname }}
{{ item.itemname }}