custom/plugins/WabsNotification/src/WabsNotification.php line 9

Open in your IDE?
  1. <?php declare(strict_types=1);
  2. namespace WabsNotification;
  3. use Shopware\Core\Framework\DataAbstractionLayer\EntityRepositoryInterface;
  4. use Shopware\Core\Framework\Plugin;
  5. use Shopware\Core\Framework\Plugin\Context\InstallContext;
  6. class WabsNotification extends Plugin
  7. {
  8.     public function install(InstallContext $installContext): void
  9.     {
  10.         $installContext->setAutoMigrate(true);
  11.         /** @var EntityRepositoryInterface $templateTypeRepository */
  12.         $templateTypeRepository $this->container->get('mail_template_type.repository');
  13.         $data = [
  14.             'id' => md5('discontinuedProducts.notification'),
  15.             'technicalName' => 'discontinuedProducts.notification',
  16.             'name' => 'Makulierungsbenachrichtigung',
  17.             'templateData' => ['products' => 'list']
  18.         ];
  19.         $templateTypeRepository->upsert([$data], $installContext->getContext());
  20.     }
  21. }