Skip to:
Content
Pages
Categories
Search
Top
Bottom

Direct profile activation without activation page


  • suparni
    Participant

    @suparni

    Hello dear community,

    I want to change the registration process.

    Normally you get an activation link by mail after filling out the form. If you click on this link, you will be taken to the registration page where you have to confirm the code again.

    Is there a possibility that you simply click on the link in the mail and the profile is activated immediately?

    Many greetings

    Suparni

Viewing 1 replies (of 1 total)

  • suparni
    Participant

    @suparni

    Unfortunately nobody could help me with the problem. So I implemented a direct solution in the database.

    I redirected people to another page and adjusted the link in the activation email accordingly.

    Example link in the email https://www.abc.de/activation/?{{user.email}}

    So when this link is called, the script asks which e-mail address is passed.

    The script then searches for the e-mail address in the table “wp_users” and changes the status in the column user_status from 2 to 0.

    The user is then immediately activated by clicking on the link. The script can be integrated into any page.

    <?php

    $queryString = strstr($_SERVER[‘REQUEST_URI’], ‘?’);
    $queryString = ($queryString===false) ? ” : substr($queryString, 1);

    $pdo = new PDO(‘mysql:host=localhost;dbname=example_db_1’, ‘example_usr_1’, ‘example password’);

    $statement = $pdo->prepare(“UPDATE wp_users SET user_status = 0 WHERE user_email = ‘$queryString'”);
    $statement->execute(array(‘user_status’ => 0));

    ?>

Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.
Skip to toolbar