Email sending through api and cli fail

  • Posts: 4
  • Thank you received: 1
1 day 14 hours ago #371566

-- HikaShop version -- : 6.4.0
-- Joomla version -- : 4.4.14
-- PHP version -- : 8.2.30
-- Browser(s) name and version -- : Firefox

Hello,

Starting to do alot more api and command line processes on our site, and having issues with Hikashop sending emails. For example, I have created a custom plugin that is called via joomla cli. Command line code:

php cli/joomla.php myplugin:send_email

In my send_email function I have
<?php
		if ( ! class_exists( 'hikashop' ) ) {
			require JPATH_ADMINISTRATOR . '/components/com_hikashop/helpers/helper.php';
		}
		$order = hikashop_get( 'class.order' )->loadNotification( $order_id, 'order_status_notification' );
		if ( empty( $order->order_id ) ) {
			return;
		}
		if ( empty( $order->mail ) ) {
			return;
		}

		hikashop_get( 'class.mail' )->sendMail( $order->mail );
?>

When I run the command, I receive this error from Hika subscription:
View not found [name, type, prefix]: orderserial, cli, orderserialView
Debug:
#0 \www\administrator\components\com_hikaserial\helpers\helper.php(223): Joomla\CMS\MVC\Controller\BaseController->getView()
#1 \www\plugins\hikashop\serials\serials.php(358): hikaserial::getLayout()
#2 \www\libraries\src\Plugin\CMSPlugin.php(289): plgHikashopSerials->onAfterOrderProductsListingDisplay()
#3 \www\libraries\vendor\joomla\event\src\Dispatcher.php(486): Joomla\CMS\Plugin\CMSPlugin->Joomla\CMS\Plugin\{closure}()
#4 \www\libraries\src\Application\EventAware.php(111): Joomla\Event\Dispatcher->dispatch()
.....

If I disable Hika subscription, Hikashop throws an error:
Call to undefined method Joomla\CMS\Application\ConsoleApplication::getTemplate()
Debug:
#0 \www\libraries\src\MVC\View\HtmlView.php(145): Joomla\CMS\MVC\View\HtmlView->_setPath()
#1 \www\libraries\src\MVC\Factory\LegacyFactory.php(111): Joomla\CMS\MVC\View\HtmlView->__construct()
#2 \www\libraries\src\MVC\Controller\BaseController.php(581): Joomla\CMS\MVC\Factory\LegacyFactory->createView()
#3 \www\administrator\components\com_hikashop\helpers\helper.php(2537): Joomla\CMS\MVC\Controller\BaseController->createView()
#4 \www\administrator\components\com_hikashop\helpers\helper.php(996): hikashopBridgeController->getNewView()
.....


I get more or less the same thing when I call the mail function via joomla api system. Any chance you could update the code so emails work offline?

Thanks

Please Log in or Create an account to join the conversation.

  • Posts: 85463
  • Thank you received: 13978
  • MODERATOR
1 day 2 hours ago #371573

Hi,

Thanks for your feedback. I've made a patch in HikaShop which will allow sending HikaShop emails in CLI. HikaSubscription will require a separate patch.
Can you update HikaShop and confirm that the patch fixes the problem when HikaSubscription is out of the picture ?

Please Log in or Create an account to join the conversation.

Time to create page: 0.055 seconds
Powered by Kunena Forum