emailSend

abstract suspend fun emailSend(request: IB2BMagicLinksDiscoveryEmailSendParameters): B2BMagicLinksDiscoveryEmailSendResponse

Sends a discovery magic link email to enumerate the organizations associated with the given email address. Calls the POST /sdk/v1/b2b/magic_links/email/discovery/send endpoint. Generates and stores a PKCE code pair for use in the subsequent authenticate call.

Kotlin:

StytchB2B.magicLinks.discovery.emailSend(
B2BMagicLinksDiscoveryEmailSendParameters(emailAddress = "user@example.com")
)

iOS:

let params = B2BMagicLinksDiscoveryEmailSendParameters(emailAddress: "user@example.com")
let response = try await StytchB2B.magicLinks.discovery.emailSend(params)

React Native:

StytchB2B.magicLinks.discovery.emailSend({ emailAddress: "user@example.com" })

Return

B2BMagicLinksDiscoveryEmailSendResponse confirming the discovery email was sent.

Parameters

request
  • IB2BMagicLinksDiscoveryEmailSendParameters

  • emailAddress — The email address to send the discovery link to.

  • discoveryRedirectUrl? — URL to redirect to after the user clicks the discovery link.

  • loginTemplateId? — Custom email template ID for the discovery email.

  • locale? — Locale used for the email content.

  • discoveryExpirationMinutes? — Expiration time for the discovery link, in minutes.

Throws

StytchError

if the request fails.

if the coroutine is cancelled.