diff --git a/courier/template/email/recovery_code_invalid.go b/courier/template/email/recovery_code_invalid.go index 0748d2dd9073..09fd9f6d8c42 100644 --- a/courier/template/email/recovery_code_invalid.go +++ b/courier/template/email/recovery_code_invalid.go @@ -18,7 +18,8 @@ type ( model *RecoveryCodeInvalidModel } RecoveryCodeInvalidModel struct { - To string + To string + TransientPayload json.RawMessage } ) diff --git a/courier/template/email/recovery_invalid.go b/courier/template/email/recovery_invalid.go index ec1f33bbb34a..c47a1aef5754 100644 --- a/courier/template/email/recovery_invalid.go +++ b/courier/template/email/recovery_invalid.go @@ -18,7 +18,8 @@ type ( m *RecoveryInvalidModel } RecoveryInvalidModel struct { - To string + To string + TransientPayload json.RawMessage } ) diff --git a/courier/template/email/verification_code_invalid.go b/courier/template/email/verification_code_invalid.go index 653cfb2e3a2b..8ff6ba72f7b7 100644 --- a/courier/template/email/verification_code_invalid.go +++ b/courier/template/email/verification_code_invalid.go @@ -18,7 +18,8 @@ type ( m *VerificationCodeInvalidModel } VerificationCodeInvalidModel struct { - To string + To string + TransientPayload json.RawMessage } ) diff --git a/courier/template/email/verification_invalid.go b/courier/template/email/verification_invalid.go index 39a9bd8e6e98..47a0359528dc 100644 --- a/courier/template/email/verification_invalid.go +++ b/courier/template/email/verification_invalid.go @@ -18,7 +18,8 @@ type ( m *VerificationInvalidModel } VerificationInvalidModel struct { - To string + To string + TransientPayload json.RawMessage } ) diff --git a/selfservice/strategy/code/code_sender.go b/selfservice/strategy/code/code_sender.go index 04b95152fb96..49734d259d08 100644 --- a/selfservice/strategy/code/code_sender.go +++ b/selfservice/strategy/code/code_sender.go @@ -72,7 +72,13 @@ func (s *Sender) SendRecoveryCode(ctx context.Context, r *http.Request, f *recov address, err := s.deps.IdentityPool().FindRecoveryAddressByValue(ctx, identity.RecoveryAddressTypeEmail, to) if err != nil { - if err := s.send(ctx, string(via), email.NewRecoveryCodeInvalid(s.deps, &email.RecoveryCodeInvalidModel{To: to})); err != nil { + if err := s.send(ctx, string(via), + email.NewRecoveryCodeInvalid( + s.deps, + &email.RecoveryCodeInvalidModel{ + To: to, + TransientPayload: transientPayload, + })); err != nil { return err } return ErrUnknownAddress @@ -146,7 +152,13 @@ func (s *Sender) SendVerificationCode(ctx context.Context, f *verification.Flow, WithField("via", via). WithSensitiveField("email_address", address). Info("Sending out invalid verification via code email because address is unknown.") - if err := s.send(ctx, string(via), email.NewVerificationCodeInvalid(s.deps, &email.VerificationCodeInvalidModel{To: to})); err != nil { + if err := s.send(ctx, string(via), + email.NewVerificationCodeInvalid( + s.deps, + &email.VerificationCodeInvalidModel{ + To: to, + TransientPayload: transientPayload, + })); err != nil { return err } return errors.Cause(ErrUnknownAddress) diff --git a/selfservice/strategy/link/sender.go b/selfservice/strategy/link/sender.go index 9ddc0c7c801c..017d12457f39 100644 --- a/selfservice/strategy/link/sender.go +++ b/selfservice/strategy/link/sender.go @@ -72,7 +72,13 @@ func (s *Sender) SendRecoveryLink(ctx context.Context, r *http.Request, f *recov address, err := s.r.IdentityPool().FindRecoveryAddressByValue(ctx, identity.RecoveryAddressTypeEmail, to) if err != nil { - if err := s.send(ctx, string(via), email.NewRecoveryInvalid(s.r, &email.RecoveryInvalidModel{To: to})); err != nil { + if err := s.send(ctx, string(via), + email.NewRecoveryInvalid( + s.r, + &email.RecoveryInvalidModel{ + To: to, + TransientPayload: transientPayload, + })); err != nil { return err } return errors.Cause(ErrUnknownAddress) @@ -113,7 +119,13 @@ func (s *Sender) SendVerificationLink(ctx context.Context, f *verification.Flow, WithField("via", via). WithSensitiveField("email_address", address). Info("Sending out invalid verification email because address is unknown.") - if err := s.send(ctx, string(via), email.NewVerificationInvalid(s.r, &email.VerificationInvalidModel{To: to})); err != nil { + if err := s.send(ctx, string(via), + email.NewVerificationInvalid( + s.r, + &email.VerificationInvalidModel{ + To: to, + TransientPayload: transientPayload, + })); err != nil { return err } return errors.Cause(ErrUnknownAddress)