Merge pull request #25994 from edx/aj/bulk-email-provide-logo-from-bkend

Provide logo URL from the backend
This commit is contained in:
Awais Jibran
2021-01-26 15:02:56 +05:00
committed by GitHub
4 changed files with 16 additions and 12 deletions

View File

@@ -2,10 +2,10 @@
Context dictionary for templates that use the ace_common base template.
"""
from django.conf import settings
from django.urls import NoReverseMatch, reverse
from lms.djangoapps.branding.api import get_logo_url_for_email
from common.djangoapps.edxmako.shortcuts import marketing_link
from openedx.core.djangoapps.theming.helpers import get_config_value_from_site_or_settings
@@ -16,7 +16,6 @@ def get_base_template_context(site):
"""
# When on LMS and a dashboard is available, use that as the dashboard url.
# Otherwise, use the home url instead.
default_logo_url = getattr(settings, 'DEFAULT_EMAIL_LOGO_URL')
try:
dashboard_url = reverse('dashboard')
except NoReverseMatch:
@@ -38,5 +37,5 @@ def get_base_template_context(site):
'CONTACT_MAILING_ADDRESS', site=site, site_config_name='contact_mailing_address'),
'social_media_urls': get_config_value_from_site_or_settings('SOCIAL_MEDIA_FOOTER_URLS', site=site),
'mobile_store_urls': get_config_value_from_site_or_settings('MOBILE_STORE_URLS', site=site),
'logo_url': getattr(settings, 'LOGO_URL_PNG', default_logo_url),
'logo_url': get_logo_url_for_email(),
}