-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmail.py
More file actions
37 lines (25 loc) · 1.24 KB
/
mail.py
File metadata and controls
37 lines (25 loc) · 1.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# -*- coding: utf-8 -*-
from email.mime.text import MIMEText
def getMail(node):
template = '''Hey {nickname},
Du hast gerade einen neuen Knoten für das Netz von Freifunk Rhein-Neckar registriert - cool!
Die Daten deines Knotens lauten:
Hostname: {hostname}
MAC: {mac}
VPN Key: {key}
Nick: {nickname}
Mail: {email}
Token: {token}
Bitte halte diese Daten aktuell. Du kannst sie unter [1] mit deinem Token pflegen.
Wir hoffen, dass Du gut zurecht gekommen bist und würden uns freuen, wenn Du dich auch persönlich in die Community einbringen würdest. Vielleicht kannst Du ja sogar noch weitere Leute von unserem Projekt überzeugen.
Solltest Du Probleme oder Anregungen haben, kannst Du die Community am besten über unser Forum [2] erreichen. Es gibt aber auch andere Kontaktmöglichkeiten [3].
Viele Grüße,
Freifunk Rhein-Neckar
[1] https://register.freifunk-rhein-neckar.de/
[2] https://forum.ffrn.de/
[3] https://www.freifunk-rhein-neckar.de/kontakt.html
'''
msg = MIMEText(template.format(**node), _charset="utf-8")
msg['Subject'] = f"Dein Freifunk Knoten - {node.get('hostname', 'unbekannt')}"
msg['Reply-To'] = "info@freifunk-rhein-neckar.de"
return msg