Use COMMON_PROJECT_URL as host for document link
Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
This commit is contained in:
@@ -265,6 +265,9 @@
|
||||
* Show a null mailer backend if there is backend with an
|
||||
invalid path. Due to the app full path change, existing
|
||||
mailer setups need to be recreated.
|
||||
* The document link URL when mailed is now composed of the
|
||||
COMMON_PROJECT_URL + document URL instead of the Site
|
||||
domain.
|
||||
|
||||
3.1.11 (2019-04-XX)
|
||||
===================
|
||||
|
||||
@@ -575,6 +575,9 @@ Other changes
|
||||
* Show a null mailer backend if there is backend with an
|
||||
invalid path. Due to the app full path change, existing
|
||||
mailer setups need to be recreated.
|
||||
* The document link URL when mailed is now composed of the
|
||||
COMMON_PROJECT_URL + document URL instead of the Site
|
||||
domain.
|
||||
|
||||
|
||||
Removals
|
||||
|
||||
@@ -3,7 +3,8 @@ from __future__ import unicode_literals
|
||||
import json
|
||||
import logging
|
||||
|
||||
from django.contrib.sites.models import Site
|
||||
from furl import furl
|
||||
|
||||
from django.core import mail
|
||||
from django.db import models, transaction
|
||||
from django.template import Context, Template
|
||||
@@ -11,6 +12,8 @@ from django.utils.html import strip_tags
|
||||
from django.utils.module_loading import import_string
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from mayan.apps.common.settings import setting_project_url
|
||||
|
||||
from .classes import NullBackend
|
||||
from .events import event_email_sent
|
||||
from .managers import UserMailerManager
|
||||
@@ -174,10 +177,9 @@ class UserMailer(models.Model):
|
||||
Send a document using this user mailing profile.
|
||||
"""
|
||||
context_dictionary = {
|
||||
'link': 'http://%s%s' % (
|
||||
Site.objects.get_current().domain,
|
||||
'link': furl(setting_project_url.value).join(
|
||||
document.get_absolute_url()
|
||||
),
|
||||
).tostr(),
|
||||
'document': document
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user