Skip to content
Snippets Groups Projects
Unverified Commit 775d3144 authored by hanfi's avatar hanfi
Browse files

make zammad/mail toggleable for development

parent 2b1cc21f
No related branches found
No related tags found
No related merge requests found
......@@ -15,6 +15,7 @@ SPECIAL_HELPDESK_ACCOUNTS = [{
}]
# mail server config
MAIL_ENABLE = True
MAIL_SERVER = 'SMTP_HOST'
MAIL_PORT = 587
MAIL_USE_TLS = True
......@@ -23,7 +24,8 @@ MAIL_USERNAME = 'SMTP_USER'
MAIL_PASSWORD = 'SMTP_PASS'
MAIL_DEFAULT_SENDER = 'no-reply@YOURDOMAIN.de'
# zammad integration config
ZAMMAD_ENABLE = True
ZAMMAD_HOST = 'zammad host'
ZAMMAD_USER = 'user'
ZAMMAD_PASS = 'pass'
......
......@@ -36,7 +36,10 @@ class User(UserMixin, db.Model):
return
# send login email
msg = Message("Your LOC transport tool credentials!", recipients=[self.login])
if app.config["MAIL_ENABLE"]:
msg = Message(
"Your LOC transport tool credentials!", recipients=[self.login]
)
msg.body = (
"Hi, na! \n\n"
"Thank you for helping us keeping an overview of your transports :) \n"
......
......@@ -190,6 +190,7 @@ def edit_transport(id=None):
#
# if ticket is new, update object with zammad ticket id
#
if app.config["ZAMMAD_ENABLE"]:
if transport.ticket_id is None:
transport.ticket_id = update_ticket(transport)
db.session.add(transport)
......@@ -322,6 +323,7 @@ def mark_transport(mark, id=None):
#
# close ticket
#
if app.config["ZAMMAD_ENABLE"]:
if transport.ticket_id:
close_ticket(transport, mark)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment