mirror of
https://github.com/inventree/InvenTree.git
synced 2025-06-19 21:45:39 +00:00
change templates to new way
This commit is contained in:
@ -16,13 +16,16 @@ logger = logging.getLogger("inventree")
|
||||
|
||||
|
||||
def notify_low_stock(part: part.models.Part):
|
||||
name = _("Low stock notification")
|
||||
message = _(f'The available stock for {part.name} has fallen below the configured minimum level')
|
||||
context = {
|
||||
# Pass the "Part" object through to the template context
|
||||
'part': part,
|
||||
'name': name,
|
||||
'message': message,
|
||||
'link': InvenTree.helpers.construct_absolute_url(part.get_absolute_url()),
|
||||
'template': {
|
||||
'html': 'email/low_stock_notification.html',
|
||||
'subject': "[InvenTree] " + _("Low stock notification"),
|
||||
'subject': "[InvenTree] " + name,
|
||||
},
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user