1616use Magento \Framework \Mail \Template \TransportBuilder ;
1717use Magento \Store \Model \StoreManagerInterface ;
1818use Opengento \Gdpr \Model \Notifier \AbstractMailSender ;
19- use Psr \Log \LoggerInterface ;
2019
2120final class MailSender extends AbstractMailSender implements SenderInterface
2221{
23- /**
24- * @var LoggerInterface
25- */
26- private LoggerInterface $ logger ;
27-
28- /**
29- * @var View
30- */
3122 private View $ customerViewHelper ;
3223
33- /**
34- * @var StoreManagerInterface
35- */
36- private $ storeManager ;
24+ private StoreManagerInterface $ storeManager ;
3725
3826 public function __construct (
39- LoggerInterface $ logger ,
4027 View $ customerViewHelper ,
4128 TransportBuilder $ transportBuilder ,
4229 ScopeConfigInterface $ scopeConfig ,
4330 StoreManagerInterface $ storeManager ,
4431 array $ configPaths
4532 ) {
46- $ this ->logger = $ logger ;
4733 $ this ->customerViewHelper = $ customerViewHelper ;
4834 $ this ->storeManager = $ storeManager ;
4935 parent ::__construct ($ transportBuilder , $ scopeConfig , $ configPaths );
5036 }
5137
5238 /**
53- * @param CustomerInterface $customer
54- * @return void
5539 * @throws LocalizedException
5640 * @throws MailException
5741 * @throws NoSuchEntityException
@@ -66,12 +50,7 @@ public function send(CustomerInterface $customer): void
6650 'customer_name ' => $ this ->customerViewHelper ->getCustomerName ($ customer ),
6751 ],
6852 ];
69-
70- try {
71- $ this ->sendMail ($ customer ->getEmail (), $ this ->customerViewHelper ->getCustomerName ($ customer ), $ storeId , $ vars );
72- $ this ->logger ->debug (__ ('GDPR Email Success ' ));
73- } catch (MailException $ exc ) {
74- $ this ->logger ->error (__ ('GDPR Email Error: %1 ' , $ exc ->getMessage ()));
75- }
53+
54+ $ this ->sendMail ($ customer ->getEmail (), $ this ->customerViewHelper ->getCustomerName ($ customer ), $ storeId , $ vars );
7655 }
7756}
0 commit comments