Generate email content from ninja2 templates
This commit is contained in:
9
files/change_notification.j2
Normal file
9
files/change_notification.j2
Normal file
@@ -0,0 +1,9 @@
|
||||
Your dynamic DNS entry has changed.
|
||||
|
||||
Hostname: {{fqdn}}
|
||||
{% if ipv4_changed %}
|
||||
IPv4 address: {{ipv4}} (changed at: {{last_ipv4_update}})
|
||||
{% endif %}
|
||||
{% if ipv6_changed %}
|
||||
IPv6 address: {{ipv6}} (changed at: {{last_ipv6_update}})
|
||||
{% endif %}
|
||||
@@ -30,6 +30,8 @@ path = "/var/lib/ddns-service/ddns.db" # required for sqlite
|
||||
# dns_timeout = 5 # default, seconds
|
||||
# ddns_default_key_file = "/etc/ddns-service/ddns.key" # optional, BIND TSIG key
|
||||
# cleanup_interval = 60 # default, seconds
|
||||
# change_notification_template = "/etc/ddns-service/change_notification.j2" # optional
|
||||
# expiry_notification_template = "/etc/ddns-service/expiry_notification.j2" # optional
|
||||
|
||||
# Per-zone TSIG key overrides (optional)
|
||||
# [dns_service.zone_keys]
|
||||
|
||||
@@ -55,6 +55,7 @@ python_install_all() {
|
||||
|
||||
dodir /etc/${PN}
|
||||
insinto /etc/${PN}
|
||||
doins files/*.j2
|
||||
insopts -m640
|
||||
newins files/config.example.toml config.toml
|
||||
fowners -R ddns:ddns /etc/${PN}
|
||||
|
||||
12
files/expiry_notification.j2
Normal file
12
files/expiry_notification.j2
Normal file
@@ -0,0 +1,12 @@
|
||||
Your dynamic DNS entry has expired due to inactivity.
|
||||
|
||||
Hostname: {{fqdn}}
|
||||
{% if ipv4_expired %}
|
||||
IPv4 address: {{last_ipv4}} (last update: {{last_ipv4_update}})
|
||||
{% endif %}
|
||||
{% if ipv6_expired %}
|
||||
IPv6 address: {{last_ipv6}} (last update: {{last_ipv6_update}})
|
||||
{% endif %}
|
||||
Expiry TTL: {{expiry_ttl}} seconds
|
||||
|
||||
The DNS records have been removed. Update your client to restore them.
|
||||
Reference in New Issue
Block a user