add automatic signature detection to email, based on pre-defined text or custom creation
This commit is contained in:
@@ -38,6 +38,7 @@ class Mail_Dialog(QtWidgets.QDialog, Ui_Dialog):
|
||||
self.subject = app_subject
|
||||
self.profname = prof_name
|
||||
self.mail_data = ""
|
||||
self.signature = self.determine_signature()
|
||||
self.prof_mail = prof_mail
|
||||
self.comboBox.currentIndexChanged.connect(self.set_mail)
|
||||
self.prof_name.setText(prof_name)
|
||||
@@ -67,6 +68,15 @@ class Mail_Dialog(QtWidgets.QDialog, Ui_Dialog):
|
||||
# # assign data["general"] to self.data
|
||||
# self.data = data["general"]
|
||||
|
||||
def determine_signature(self):
|
||||
if config.mail.signature == None:
|
||||
return """Mit freundlichen Grüßen
|
||||
Ihr Semesterapparatsteam
|
||||
Mail: semesterapparate@ph-freiburg.de
|
||||
Tel.: 0761/682-778"""
|
||||
else:
|
||||
return config.mail.signature
|
||||
|
||||
def load_mail_templates(self):
|
||||
print("loading mail templates")
|
||||
|
||||
@@ -108,6 +118,7 @@ class Mail_Dialog(QtWidgets.QDialog, Ui_Dialog):
|
||||
AppNr=self.appid,
|
||||
AppSubject=self.subject,
|
||||
greeting=self.get_greeting(),
|
||||
signature=self.signature,
|
||||
)
|
||||
|
||||
self.mail_body.setHtml(mail_html)
|
||||
|
||||
Reference in New Issue
Block a user