mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
change templates to new way
This commit is contained in:
parent
febc51466a
commit
1ba7110cda
@ -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,
|
||||
},
|
||||
}
|
||||
|
||||
|
@ -4,7 +4,7 @@
|
||||
{% load inventree_extras %}
|
||||
|
||||
{% block title %}
|
||||
{% blocktrans with part=part.name %} The available stock for {{ part }} has fallen below the configured minimum level{% endblocktrans %}
|
||||
{{ message }}
|
||||
{% if link %}
|
||||
<p>{% trans "Click on the following link to view this part" %}: <a href="{{ link }}">{{ link }}</a></p>
|
||||
{% endif %}
|
||||
|
Loading…
Reference in New Issue
Block a user