diff --git a/README.md b/README.md index f9d7c5c..451a136 100644 --- a/README.md +++ b/README.md @@ -452,6 +452,7 @@ Templates use Jinja2 syntax. Available variables: | ipv6_changed | Boolean, IPv6 changed | | ipv6 | Current IPv6 address | | last_ipv6_update | Last IPv6 update time | +| expiry_ttl_changed | Boolean, Expiry-TTL changed | | expiry_ttl | Expiry TTL in seconds | **Expiry notification:** diff --git a/files/change_notification.j2 b/files/change_notification.j2 index b00b3a8..cd95402 100644 --- a/files/change_notification.j2 +++ b/files/change_notification.j2 @@ -7,3 +7,6 @@ IPv4 address: {{ipv4}} (changed at: {{last_ipv4_update}}) {% if ipv6_changed %} IPv6 address: {{ipv6}} (changed at: {{last_ipv6_update}}) {% endif %} +{% if expiry_ttl_changed %} +Expiry-TTL: {{expiry_ttl}} +{% endif %} diff --git a/src/ddns_service/email.py b/src/ddns_service/email.py index d920c3f..82edc4d 100644 --- a/src/ddns_service/email.py +++ b/src/ddns_service/email.py @@ -98,7 +98,8 @@ class EmailService: email, hostname, ipv4_changed, - ipv6_changed + ipv6_changed, + expiry_ttl_changed ): """ Send hostname changed notification email. @@ -131,6 +132,7 @@ class EmailService: "ipv6_changed": ipv6_changed, "ipv6": hostname.last_ipv6, "last_ipv6_update": datetime_str(hostname.last_ipv6_update), + "expiry_ttl_changed": expiry_ttl_changed, "expiry_ttl": hostname.expiry_ttl, } diff --git a/src/ddns_service/server.py b/src/ddns_service/server.py index 5ff6284..9676f42 100644 --- a/src/ddns_service/server.py +++ b/src/ddns_service/server.py @@ -659,7 +659,8 @@ class DDNSRequestHandler(BaseHTTPRequestHandler): hostname.user.email, hostname, ipv4_changed, - ipv6_changed + ipv6_changed, + expiry_ttl_changed ) except Exception as e: logging.error(f"Sending change notification error: {e}")