What happened?
Description
I have a custom plugin that sends form data to a controller where a new user is created if it does not exist yet. In that case the sendActivationEmail method is used like this Craft::$app->users->sendActivationEmail($user);.
Later in the controller I also create a PDF that uses a twig template like this:
$htmlContent = Craft::$app->getView()->renderTemplate('_receipts/pdf/receipt.twig', [ 'receipt' => $receipt, ]);
For some reason when performing these actions in this order I get the error that the "_receipts/pdf/receipt.twig" template can't be found.
Commenting out the sendActivationEmail method "fixes" it.
There must be something in the sendActivationEmail method that breaks the ability to reference templates.
This did not happen in the last year so I suppose it must be related to a recent update.
The site is completely up to date.
Steps to reproduce
- Create new user and send the activation mail using
Craft::$app->users->sendActivationEmail($user);
- Then try to reference another template in the plugin for a PDF or something else
Expected behavior
The template should be found.
Actual behavior
"_receipts/pdf/receipt.twig" template can't be found.
Craft CMS version
5.6.17
PHP version
8.2
Operating system and version
No response
Database type and version
No response
Image driver and version
No response
Installed plugins and versions
What happened?
Description
I have a custom plugin that sends form data to a controller where a new user is created if it does not exist yet. In that case the sendActivationEmail method is used like this
Craft::$app->users->sendActivationEmail($user);.Later in the controller I also create a PDF that uses a twig template like this:
$htmlContent = Craft::$app->getView()->renderTemplate('_receipts/pdf/receipt.twig', [ 'receipt' => $receipt, ]);For some reason when performing these actions in this order I get the error that the "_receipts/pdf/receipt.twig" template can't be found.
Commenting out the sendActivationEmail method "fixes" it.
There must be something in the sendActivationEmail method that breaks the ability to reference templates.
This did not happen in the last year so I suppose it must be related to a recent update.
The site is completely up to date.
Steps to reproduce
Craft::$app->users->sendActivationEmail($user);Expected behavior
The template should be found.
Actual behavior
"_receipts/pdf/receipt.twig" template can't be found.
Craft CMS version
5.6.17
PHP version
8.2
Operating system and version
No response
Database type and version
No response
Image driver and version
No response
Installed plugins and versions