@@ -591,7 +591,7 @@ public function testSendNotificationEmailsIfRequired()
591
591
->get (MutableScopeConfigInterface::class);
592
592
$ config ->setValue (
593
593
'admin/emails/new_user_notification_template ' ,
594
- $ this ->getCustomEmailTemplateIdForNewUserNotification (
594
+ $ this ->getCustomEmailTemplateId (
595
595
'admin_emails_new_user_notification_template '
596
596
)
597
597
);
@@ -621,17 +621,17 @@ public function testSendNotificationEmailsIfRequired()
621
621
}
622
622
623
623
/**
624
- * Return email template id for new user notification
624
+ * Return email template id by origin template code
625
625
*
626
626
* @param string $origTemplateCode
627
627
* @return int|null
628
628
* @throws NotFoundException
629
629
*/
630
- private function getCustomEmailTemplateIdForNewUserNotification (string $ origTemplateCode ): ?int
630
+ private function getCustomEmailTemplateId (string $ origTemplateCode ): ?int
631
631
{
632
632
$ templateId = null ;
633
633
$ templateCollection = Bootstrap::getObjectManager ()
634
- ->get (TemplateCollection::class);
634
+ ->create (TemplateCollection::class);
635
635
foreach ($ templateCollection as $ template ) {
636
636
if ($ template ->getOrigTemplateCode () == $ origTemplateCode ) {
637
637
$ templateId = (int ) $ template ->getId ();
@@ -659,7 +659,7 @@ public function testNotificationEmailsIfResetPassword()
659
659
->get (MutableScopeConfigInterface::class);
660
660
$ config ->setValue (
661
661
'admin/emails/forgot_email_template ' ,
662
- $ this ->getCustomEmailTemplateIdForNewUserNotification (
662
+ $ this ->getCustomEmailTemplateId (
663
663
'admin_emails_forgot_email_template '
664
664
)
665
665
);
0 commit comments