diff --git a/helpdesk/models.py b/helpdesk/models.py index 6264cf84..971cc598 100644 --- a/helpdesk/models.py +++ b/helpdesk/models.py @@ -666,7 +666,12 @@ class Ticket(models.Model): site = Site.objects.get_current() except ImproperlyConfigured: site = Site(domain='configure-django-sites.com') - return u"http://%s%s?ticket=%s&email=%s&key=%s" % ( + if settings.HELPDESK_USE_HTTPS_IN_EMAIL_LINK: + protocol = 'https' + else: + protocol = 'http' + return u"%s://%s%s?ticket=%s&email=%s&key=%s" % ( + protocol, site.domain, reverse('helpdesk:public_view'), self.ticket_for_url, @@ -687,7 +692,12 @@ class Ticket(models.Model): site = Site.objects.get_current() except ImproperlyConfigured: site = Site(domain='configure-django-sites.com') - return u"http://%s%s" % ( + if settings.HELPDESK_USE_HTTPS_IN_EMAIL_LINK: + protocol = 'https' + else: + protocol = 'http' + return u"%s://%s%s" % ( + protocol, site.domain, reverse('helpdesk:view', args=[self.id]) diff --git a/helpdesk/settings.py b/helpdesk/settings.py index 5503f3d6..7142ce18 100644 --- a/helpdesk/settings.py +++ b/helpdesk/settings.py @@ -149,6 +149,8 @@ QUEUE_EMAIL_BOX_UPDATE_ONLY = getattr(settings, 'QUEUE_EMAIL_BOX_UPDATE_ONLY', F HELPDESK_ENABLE_PER_QUEUE_STAFF_PERMISSION = getattr( settings, 'HELPDESK_ENABLE_PER_QUEUE_STAFF_PERMISSION', False) +# use https in the email links +HELPDESK_USE_HTTPS_IN_EMAIL_LINK = getattr(settings, 'HELPDESK_USE_HTTPS_IN_EMAIL_LINK', False) # Asynchronous Datatables - Optional HELPDESK_USE_SERVERSIDE_PROCESSING = getattr(