Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Send email with verification code

Description

Sends an email verification code.

Package Details

Interface

IEmailNotificationManager

Syntax

Task<bool> SendEmailVerificationCode(int userId, string url, string confirmationCode, bool isEnglish);

Returns

Task<bool>

API Enpoint

POST

/api/v1/notifications/verificationcode

Parameters:

  • dto: [EmailVerificationDTO] - Email verification dto.

...

Parameter

Description

Parameter Type

emailVerificationDTO

An object with all the properties to send a verification code to a user.

Request body

Sample request body

Code Block
languagejson
{
  "UserId": 0,
  "Url": "string",
  "ConfirmationCode": "string",
  "IsEnglish": true
}

...

Return

...

HTTP 200 OK if successful, 401 if unauthorized, 400 otherwise.200 OK - Successful.

400 Bad Request - Unable to send the verification email.

Example

Code Block
languagec#
const int userId = 200;
const string url = "https://www.tc.gc.ca";
const string confirmationCode = "XYZ";
const bool IsEnglish = true;

var result = await emailNotificationManager.SendEmailVerificationCode(userId, returnUrl, confirmationCode, isEnglish);