Create Email Confirmation¶
Description¶
A confirmation email message includes a special link the user clicks to confirm their email address. When the link is clicked and the link is not expired, the user status changes from EMAIL_CONFIRMATION_PENDING
to ENABLED
. The email message delivered to the user is created from the Confirmation template located in Messaging > Emails in Backendless Console. There are scenarios when the link needs to be generated in your application logic, for instance, if you need to send it out via text message or if you need to generate the confirmation email dynamically.
Method¶
Non-Blocking API
public void Backendless.UserService.CreateEmailConfirmationURL( String identityValue, AsyncCallback<String> callback )
public async Task Backendless.UserService.CreateEmailConfirmationURLAsync( String identityValue )
Blocking API
public void Backendless.UserService.CreateEmailConfirmationURL( String identityValue );
where:
Argument | Description |
---|---|
identityValue |
Value in a column marked as identity in the Users table. By default a Backendless application has email as the identity column. In that case the parameter for the API should be the email address of a user. Can be a string value or a number. |
callback |
An object which receives either a return value or an error from the server. The return value from the server the BackendlessUser object with the ID assigned by the server-side. |
Return Value¶
An object containing confirmation URL as a string value.
Example¶
The example below creates a new confirmation email and sends it to the "alice@yourmail.com"
.
Non-Blocking API
// Async callback method call:
String email = "alice@yourmail.com"; Backendless.UserService.CreateEmailConfirmationURL(email, new BackendlessAPI.Async.AsyncCallback<String>(
response =>
{
// Result
},
fault =>
{
// Error has appeared
}));
// Async method call:
String email = "alice@yourmail.com";
Backendless.UserService.CreateEmailConfirmationURLAsync( email );
Blocking API
String email = "alice@yourmail.com";
Backendless.UserService.CreateEmailConfirmationURL( email );