File tree Expand file tree Collapse file tree 1 file changed +20
-2
lines changed
app/Jobs/Emails/Registration/PromoCodes Expand file tree Collapse file tree 1 file changed +20
-2
lines changed Original file line number Diff line number Diff line change @@ -36,10 +36,14 @@ protected function getEmailEventSlug(): string
36
36
const DEFAULT_TEMPLATE = 'SUMMIT_REGISTRATION_SPONSOR_PROMO_CODE ' ;
37
37
38
38
/**
39
- * SponsorPromoCodeEmail constructor.
40
39
* @param SummitRegistrationPromoCode $promo_code
40
+ * @param string|null $test_email_recipient
41
41
*/
42
- public function __construct (SummitRegistrationPromoCode $ promo_code )
42
+ public function __construct
43
+ (
44
+ SummitRegistrationPromoCode $ promo_code ,
45
+ ?string $ test_email_recipient
46
+ )
43
47
{
44
48
Log::debug ("SponsorPromoCodeEmail::__construct " );
45
49
@@ -64,6 +68,20 @@ public function __construct(SummitRegistrationPromoCode $promo_code)
64
68
$ payload [IMailTemplatesConstants::contact_email] = $ recipient ;
65
69
66
70
$ template_identifier = $ this ->getEmailTemplateIdentifierFromEmailEvent ($ summit );
71
+ if (!empty ($ test_email_recipient )) {
72
+ Log::debug
73
+ (
74
+ sprintf
75
+ (
76
+ "SponsorPromoCodeEmail::__construct replacing original email %s by %s " ,
77
+ $ recipient ,
78
+ $ test_email_recipient
79
+ )
80
+ );
81
+
82
+ $ payload [IMailTemplatesConstants::contact_email] = $ test_email_recipient ;
83
+ $ recipient = $ test_email_recipient ;
84
+ }
67
85
parent ::__construct ($ summit , $ payload , $ template_identifier , $ recipient );
68
86
Log::debug (sprintf ("SponsorPromoCodeEmail::__construct %s " , $ this ->template_identifier ));
69
87
}
You can’t perform that action at this time.
0 commit comments