16
16
use Magento \Framework \Mail \Template \TransportBuilder ;
17
17
use Magento \Store \Model \StoreManagerInterface ;
18
18
use Opengento \Gdpr \Model \Notifier \AbstractMailSender ;
19
- use Psr \Log \LoggerInterface ;
20
19
21
20
final class MailSender extends AbstractMailSender implements SenderInterface
22
21
{
23
- /**
24
- * @var LoggerInterface
25
- */
26
- private LoggerInterface $ logger ;
27
-
28
- /**
29
- * @var View
30
- */
31
22
private View $ customerViewHelper ;
32
23
33
- /**
34
- * @var StoreManagerInterface
35
- */
36
- private $ storeManager ;
24
+ private StoreManagerInterface $ storeManager ;
37
25
38
26
public function __construct (
39
- LoggerInterface $ logger ,
40
27
View $ customerViewHelper ,
41
28
TransportBuilder $ transportBuilder ,
42
29
ScopeConfigInterface $ scopeConfig ,
43
30
StoreManagerInterface $ storeManager ,
44
31
array $ configPaths
45
32
) {
46
- $ this ->logger = $ logger ;
47
33
$ this ->customerViewHelper = $ customerViewHelper ;
48
34
$ this ->storeManager = $ storeManager ;
49
35
parent ::__construct ($ transportBuilder , $ scopeConfig , $ configPaths );
50
36
}
51
37
52
38
/**
53
- * @param CustomerInterface $customer
54
- * @return void
55
39
* @throws LocalizedException
56
40
* @throws MailException
57
41
* @throws NoSuchEntityException
@@ -66,12 +50,7 @@ public function send(CustomerInterface $customer): void
66
50
'customer_name ' => $ this ->customerViewHelper ->getCustomerName ($ customer ),
67
51
],
68
52
];
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 );
76
55
}
77
56
}
0 commit comments