Account Activation
On this page, we dive into Account Activation Emails and how you can use them to confirm the emails of your users.
Why is Account Activation important?
Account Activation is important because it allows you to confirm that the email address of a user is valid. This is important because it allows you to prevent users from signing up with fake email addresses.
How does Account Activation work?
Account Activation works by sending an email to a user with a link that they must click to confirm their email address. Once the user clicks the link, you can verify that the email address is valid.
Creating an Activation Link
You verify an Activation Link by sending a POST request to https://api.devrift.co
.
Below is a list of parameters that you'll need:
at
parameter must be set toactivation_create
.em
parameter must be set to the email address of the user.
at
means api_type
. This is used to tell the API what type of request you are making. In this case, we are making an Activation Verify request.
em
means email
. This is the email address of the user that you want to send the Activation Link to.
Example Request
curl -X POST https://api.devrift.co/v1 \
-H "Authorization: Bearer {sk_test_foobar...}" \
-d "at=activation_create, em=YOUR_USERS_EMAIL"
Below we show you how to do this using our PHP SDK.
// Import the DevRIFT SDK
use DevRift\DevRift;
// Import the Activation Request class
use DevRift\Activation\Request;
// snip...
// Set your Secret Key
DevRIFT::setApiKey("sk_test_foobar...");
// Create an Activation Link with YOUR_USERS_EMAIL
Activation::request(YOUR_USERS_EMAIL);
Verifying an Activation Link
You verify an Activation Link by sending a POST request to https://api.devrift.co
.
Below is a list of parameters that you'll need:
at
parameter must be set toactivation_verify
.vl
parameter must be set to thevl
parameter from the Activation Link.sr
parameter must be set to thesr
parameter from the Activation Link.
at
means api_type
. This is used to tell the API what type of request you are making. In this case, we are making an Activation Verify request.
Below we show you how to do this using our PHP SDK.
// Import the DevRIFT SDK
use DevRift\DevRift;
// Import the Activation Verify class
use DevRift\Activation\Verify;
// snip...
// Set your Secret Key
DevRIFT::setApiKey("sk_test_foobar...");
// Verifies the Activation Link and returns the email address
$email = Activation::verify();
Our PHP SDK collects the GET Request Data vl
and sr
. You must make sure that your application does not interfere with these variables.
If you interfere with these variables, you will not be able to verify the Magic Link.