MCPcopy Index your code
hub / github.com/supabase/auth / sendEmailChangedNotification

Method sendEmailChangedNotification

internal/api/mail.go:606–621  ·  view source on GitHub ↗
(r *http.Request, tx *storage.Connection, u *models.User, oldEmail string)

Source from the content-addressed store, hash-verified

604}
605
606func (a *API) sendEmailChangedNotification(r *http.Request, tx *storage.Connection, u *models.User, oldEmail string) error {
607 err := a.sendEmail(r, tx, u, sendEmailParams{
608 emailActionType: mail.EmailChangedNotification,
609 oldEmail: oldEmail,
610 })
611 if err != nil {
612 if errors.Is(err, EmailRateLimitExceeded) {
613 return apierrors.NewTooManyRequestsError(apierrors.ErrorCodeOverEmailSendRateLimit, "%s", EmailRateLimitExceeded.Error())
614 } else if herr, ok := err.(*HTTPError); ok {
615 return herr
616 }
617 return apierrors.NewInternalServerError("Error sending email changed notification email").WithInternalError(err)
618 }
619
620 return nil
621}
622
623func (a *API) sendPhoneChangedNotification(r *http.Request, tx *storage.Connection, u *models.User, oldPhone string) error {
624 err := a.sendEmail(r, tx, u, sendEmailParams{

Calls 6

sendEmailMethod · 0.95
NewTooManyRequestsErrorFunction · 0.92
NewInternalServerErrorFunction · 0.92
IsMethod · 0.45
ErrorMethod · 0.45
WithInternalErrorMethod · 0.45