Fix email logo when sending via a cron script BT#17386

webservicelpcreate
Julio Montoya 5 years ago
parent 4f4f3dde73
commit 67344d0e66
  1. 10
      main/cron/scheduled_announcement.php
  2. 9
      src/Chamilo/CoreBundle/Component/Utils/ChamiloApi.php

@ -1,14 +1,14 @@
<?php
/* For licensing terms, see /license.txt */
require_once __DIR__.'/../inc/global.inc.php';
require __DIR__.'/../inc/global.inc.php';
$urlList = UrlManager::get_url_data();
foreach ($urlList as $url) {
// Set access_url to set correct paths.
$_configuration['access_url'] = $url['id'];
echo "Portal: # ".$url['id']." - ".$url['url'].'-'.api_get_path(WEB_CODE_PATH).PHP_EOL;
$urlId = $url['id'];
$_configuration['access_url'] = $urlId;
echo "Portal: # ".$urlId." - ".$url['url'].'-'.api_get_path(WEB_CODE_PATH).PHP_EOL;
$object = new ScheduledAnnouncement();
$messagesSent = $object->sendPendingMessages($url['id']);
$messagesSent = $object->sendPendingMessages($urlId);
echo "Messages sent $messagesSent".PHP_EOL;
}

@ -88,6 +88,12 @@ class ChamiloApi
if (!isset($logoPath)) {
$theme = empty($theme) ? api_get_visual_theme() : $theme;
$accessUrlId = api_get_current_access_url_id();
if ('cli' === PHP_SAPI) {
$accessUrl = api_get_configuration_value('access_url');
if (!empty($accessUrl)) {
$accessUrlId = $accessUrl;
}
}
$themeDir = \Template::getThemeDir($theme);
$customLogoPath = $themeDir."images/header-logo-custom$accessUrlId.png";
@ -118,7 +124,7 @@ class ChamiloApi
}
$originalLogoPath = $themeDir."images/header-logo.png";
if ($svgIcons == 'true') {
if ($svgIcons === 'true') {
$originalLogoPathSVG = $themeDir."images/header-logo.svg";
if (file_exists(api_get_path(SYS_CSS_PATH).$originalLogoPathSVG)) {
if ($getSysPath) {
@ -131,6 +137,7 @@ class ChamiloApi
return $logoPath;
}
}
if (file_exists(api_get_path(SYS_CSS_PATH).$originalLogoPath)) {
if ($getSysPath) {
$logoPath = api_get_path(SYS_CSS_PATH).$originalLogoPath;

Loading…
Cancel
Save