prevent sending email when no recipients
This commit is contained in:
@@ -284,6 +284,7 @@ func (s *serviceImpl) AcceptInvitation(ctx context.Context, networkID, email, hu
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if len(emailRecipients) > 0 {
|
||||||
newMemberEmailPrefix := strings.Split(normalized, "@")[0]
|
newMemberEmailPrefix := strings.Split(normalized, "@")[0]
|
||||||
_, err = s.aeroSvc.ShootEmail(ctx, &pbaero.ShootEmailRequest{
|
_, err = s.aeroSvc.ShootEmail(ctx, &pbaero.ShootEmailRequest{
|
||||||
ToEmails: emailRecipients,
|
ToEmails: emailRecipients,
|
||||||
@@ -298,6 +299,7 @@ func (s *serviceImpl) AcceptInvitation(ctx context.Context, networkID, email, hu
|
|||||||
flog.Warn("unable to send email notification", "email", email, "network", network.Name)
|
flog.Warn("unable to send email notification", "email", email, "network", network.Name)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
s.mirrorAddMembership(ctx, humanId, networkID)
|
s.mirrorAddMembership(ctx, humanId, networkID)
|
||||||
return nil
|
return nil
|
||||||
|
|||||||
Reference in New Issue
Block a user