email

package
v15.10.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 14, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LoginOrCreateParams

type LoginOrCreateParams struct {
	// Email: The email address of the user to send the one-time passcode to. You may use sandbox@stytch.com to
	// test this endpoint, see [Testing](https://stytch.com/docs/home#resources_testing) for more detail.
	Email string `json:"email,omitempty"`
	// ExpirationMinutes: Set the expiration for the one-time passcode, in minutes. The minimum expiration is 1
	// minute and the maximum is 10 minutes. The default expiration is 2 minutes.
	ExpirationMinutes int32 `json:"expiration_minutes,omitempty"`
	// Attributes: Provided attributes help with fraud detection.
	Attributes *attribute.Attributes `json:"attributes,omitempty"`
	// CreateUserAsPending: Flag for whether or not to save a user as pending vs active in Stytch. Defaults to
	// false.
	//         If true, users will be saved with status pending in Stytch's backend until authenticated.
	//         If false, users will be created as active. An example usage of
	//         a true flag would be to require users to verify their phone by entering the OTP code before
	// creating
	//         an account for them.
	CreateUserAsPending bool `json:"create_user_as_pending,omitempty"`
	// Locale: Used to determine which language to use when sending the user this delivery method. Parameter is
	// a [IETF BCP 47 language tag](https://www.w3.org/International/articles/language-tags/), e.g. `"en"`.
	//
	// Currently supported languages are English (`"en"`), Spanish (`"es"`), and Brazilian Portuguese
	// (`"pt-br"`); if no value is provided, the copy defaults to English.
	//
	// Request support for additional languages
	// [here](https://docs.google.com/forms/d/e/1FAIpQLScZSpAu_m2AmLXRT3F3kap-s_mcV6UTBitYn6CdyWP0-o7YjQ/viewform?usp=sf_link")!
	//
	Locale LoginOrCreateRequestLocale `json:"locale,omitempty"`
	// LoginTemplateID: Use a custom template for login emails. By default, it will use your default email
	// template. The template must be a template using our built-in customizations or a custom HTML email for
	// Magic links - Login.
	LoginTemplateID string `json:"login_template_id,omitempty"`
	// SignupTemplateID: Use a custom template for sign-up emails. By default, it will use your default email
	// template. The template must be a template using our built-in customizations or a custom HTML email for
	// Magic links - Sign-up.
	SignupTemplateID string `json:"signup_template_id,omitempty"`
}

LoginOrCreateParams: Request type for `Email.LoginOrCreate`.

type LoginOrCreateRequestLocale

type LoginOrCreateRequestLocale string
const (
	LoginOrCreateRequestLocaleEn   LoginOrCreateRequestLocale = "en"
	LoginOrCreateRequestLocaleEs   LoginOrCreateRequestLocale = "es"
	LoginOrCreateRequestLocalePtbr LoginOrCreateRequestLocale = "pt-br"
)

type LoginOrCreateResponse

type LoginOrCreateResponse struct {
	// RequestID: Globally unique UUID that is returned with every API call. This value is important to log for
	// debugging purposes; we may ask for this value to help identify a specific API call when helping you
	// debug an issue.
	RequestID string `json:"request_id,omitempty"`
	// UserID: The unique ID of the affected User.
	UserID string `json:"user_id,omitempty"`
	// EmailID: The unique ID of a specific email address.
	EmailID string `json:"email_id,omitempty"`
	// UserCreated: In `login_or_create` endpoints, this field indicates whether or not a User was just created.
	UserCreated bool `json:"user_created,omitempty"`
	// StatusCode: The HTTP status code of the response. Stytch follows standard HTTP response status code
	// patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX
	// are server errors.
	StatusCode int32 `json:"status_code,omitempty"`
}

LoginOrCreateResponse: Response type for `Email.LoginOrCreate`.

type SendParams

type SendParams struct {
	// Email: The email address of the user to send the one-time passcode to. You may use sandbox@stytch.com to
	// test this endpoint, see [Testing](https://stytch.com/docs/home#resources_testing) for more detail.
	Email string `json:"email,omitempty"`
	// ExpirationMinutes: Set the expiration for the one-time passcode, in minutes. The minimum expiration is 1
	// minute and the maximum is 10 minutes. The default expiration is 2 minutes.
	ExpirationMinutes int32 `json:"expiration_minutes,omitempty"`
	// Attributes: Provided attributes help with fraud detection.
	Attributes *attribute.Attributes `json:"attributes,omitempty"`
	// Locale: Used to determine which language to use when sending the user this delivery method. Parameter is
	// a [IETF BCP 47 language tag](https://www.w3.org/International/articles/language-tags/), e.g. `"en"`.
	//
	// Currently supported languages are English (`"en"`), Spanish (`"es"`), and Brazilian Portuguese
	// (`"pt-br"`); if no value is provided, the copy defaults to English.
	//
	// Request support for additional languages
	// [here](https://docs.google.com/forms/d/e/1FAIpQLScZSpAu_m2AmLXRT3F3kap-s_mcV6UTBitYn6CdyWP0-o7YjQ/viewform?usp=sf_link")!
	//
	Locale SendRequestLocale `json:"locale,omitempty"`
	// UserID: The unique ID of a specific User.
	UserID string `json:"user_id,omitempty"`
	// SessionToken: The `session_token` associated with a User's existing Session.
	SessionToken string `json:"session_token,omitempty"`
	// SessionJWT: The `session_jwt` associated with a User's existing Session.
	SessionJWT string `json:"session_jwt,omitempty"`
	// LoginTemplateID: Use a custom template for login emails. By default, it will use your default email
	// template. The template must be a template using our built-in customizations or a custom HTML email for
	// OTP - Login.
	LoginTemplateID string `json:"login_template_id,omitempty"`
	// SignupTemplateID: Use a custom template for sign-up emails. By default, it will use your default email
	// template. The template must be a template using our built-in customizations or a custom HTML email for
	// OTP - Sign-up.
	SignupTemplateID string `json:"signup_template_id,omitempty"`
}

SendParams: Request type for `Email.Send`.

type SendRequestLocale

type SendRequestLocale string
const (
	SendRequestLocaleEn   SendRequestLocale = "en"
	SendRequestLocaleEs   SendRequestLocale = "es"
	SendRequestLocalePtbr SendRequestLocale = "pt-br"
)

type SendResponse

type SendResponse struct {
	// RequestID: Globally unique UUID that is returned with every API call. This value is important to log for
	// debugging purposes; we may ask for this value to help identify a specific API call when helping you
	// debug an issue.
	RequestID string `json:"request_id,omitempty"`
	// UserID: The unique ID of the affected User.
	UserID string `json:"user_id,omitempty"`
	// EmailID: The unique ID of a specific email address.
	EmailID string `json:"email_id,omitempty"`
	// StatusCode: The HTTP status code of the response. Stytch follows standard HTTP response status code
	// patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX
	// are server errors.
	StatusCode int32 `json:"status_code,omitempty"`
}

SendResponse: Response type for `Email.Send`.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL