Hi,
code from 2024 worked, now in 2025 seems to have lost ability to load an email template…
note this is a custom file.
this is the header
namespace PHPMaker2025\dams;
use DI\ContainerBuilder;
// Autoload
require_once "../vendor/autoload.php";
// Require files
require_once "../src/constants.php";
require_once "../src/config.php";
require_once "../src/phpfn.php";
require_once "../src/userfn.php";
$containerBuilder = new ContainerBuilder();
$containerBuilder->useAttributes(true);
// Add definitions
$containerBuilder->addDefinitions("../src/definitions.php");
// Dispatch container build event
DispatchEvent(new ContainerBuildEvent($containerBuilder), ContainerBuildEvent::NAME);
// Build PHP-DI container instance
$container = $containerBuilder->build();
HP Fatal error: Uncaught Slim\Views\Exception\PhpTemplateNotFoundException: View cannot render “NotifyCampaignEnding.en-US.php” because the template does not exist in vendor/slim/php-view/src/PhpRenderer.php:176
is there an email container that we need to create?
this is the pertinent code. (some removed for clarity)
function _sendCampaignExpiring($row, $args) {
$GLOBALS["RELATIVE_PATH"] = "../";
$email = new Email();
$email->Format = "html";
$msg_template = 'NotifyCampaignEnding.php';
$email->load($msg_template, data: [
"From" => Config("SENDER_EMAIL"), // Replace Sender
"To" => $recipient, // Replace Recipient
"Cc" => $Cc,
"Subject" => $subject, // Replace Subject
"campaign_ends" => $campaign_ends,
"campaign_name" => $campaign_name,
"document_name" => $document_name,
"dt" => $dt
]);
}
works perfectly fine in v2024.
this is the 2024 header
namespace PHPMaker2024\dams;
use PHPMaker2024\dams\{UserProfile, Language, AdvancedSecurity, Timer, HttpErrorHandler, RouteAttributes, SessionHandler};
use Psr\Http\Message\ServerRequestInterface as Request;
use Psr\Http\Message\ResponseInterface as Response;
use Psr\Container\ContainerInterface;
use DI\Container as Container;
use DI\ContainerBuilder;
use Slim\Factory\AppFactory;
use Slim\Factory\ServerRequestCreatorFactory;
use Slim\Exception\HttpInternalServerErrorException;
use Middlewares\Whoops;
use Dflydev\DotAccessData\Data;
use Selective\SameSiteCookie\SameSiteSessionMiddleware;
use Doctrine\DBAL\DriverManager;
use Doctrine\DBAL\ParameterType;
use Doctrine\DBAL\Connection;
require_once "../vendor/autoload.php";
// Require files
require_once "../src/constants.php";
require_once "../src/config.php";
require_once "../src/phpfn.php";
$ConfigData = new Data($CONFIG); // Ensure that $ConfigData is accessible by Global Codes
require_once "../src/userfn.php";
$containerBuilder = new ContainerBuilder();
$containerBuilder->useAttributes(true);
$containerBuilder->addDefinitions("../src/definitions.php");
$container = $containerBuilder->build();
thanks,
JS