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
3636 const DEFAULT_TEMPLATE = 'SUMMIT_REGISTRATION_SPONSOR_PROMO_CODE ' ;
3737
3838 /**
39- * SponsorPromoCodeEmail constructor.
4039 * @param SummitRegistrationPromoCode $promo_code
40+ * @param string|null $test_email_recipient
4141 */
42- public function __construct (SummitRegistrationPromoCode $ promo_code )
42+ public function __construct
43+ (
44+ SummitRegistrationPromoCode $ promo_code ,
45+ ?string $ test_email_recipient
46+ )
4347 {
4448 Log::debug ("SponsorPromoCodeEmail::__construct " );
4549
@@ -64,6 +68,20 @@ public function __construct(SummitRegistrationPromoCode $promo_code)
6468 $ payload [IMailTemplatesConstants::contact_email] = $ recipient ;
6569
6670 $ 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+ }
6785 parent ::__construct ($ summit , $ payload , $ template_identifier , $ recipient );
6886 Log::debug (sprintf ("SponsorPromoCodeEmail::__construct %s " , $ this ->template_identifier ));
6987 }
You can’t perform that action at this time.
0 commit comments