account.sendVerifyEmailCode
Send an email verification code.
func (c *Client) AccountSendVerifyEmailCode(ctx context.Context, request *AccountSendVerifyEmailCodeRequest) (*AccountSentEmailCode, error)
Calling this method
client.Run(ctx, func(ctx context.Context) error {
api := client.API()
res, err := api.AccountSendVerifyEmailCode(ctx, &tg.AccountSendVerifyEmailCodeRequest{
// see Parameters
})
if err != nil {
return err
}
_ = res // *AccountSentEmailCode
return nil
})
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
Purpose | EmailVerifyPurposeClass | yes | Verification purpose. |
Email | string | yes | The email where to send the code. |
Returns
Possible errors
| Code | Type | Description |
|---|---|---|
| 400 | EMAIL_INVALID | The specified email is invalid. |
| 400 | EMAIL_NOT_ALLOWED | The specified email cannot be used to complete the operation. |
| 400 | EMAIL_NOT_SETUP | In order to change the login email with emailVerifyPurposeLoginChange, an existing login email must already be set using emailVerifyPurposeLoginSetup. |
| 400 | PHONE_CODE_EMPTY | phone_code is missing. |
| 400 | PHONE_HASH_EXPIRED | An invalid or expired phone_code_hash was provided. |
| 400 | PHONE_NUMBER_INVALID | The phone number is invalid. |
References
- Official documentation
- Generated Go reference
- TL definition:
account.sendVerifyEmailCode#98e037bb