[HOW TO] Remove New User Activation Email

  • Sticky
    Posted in: Arcane  
  • Member
    November 5, 2020 at 8:25 pm #127264

    So I did a similar thing back in BlackFyre to remove the activation email for new users to just allow them to signup and immediately start using the site.
    This will be a similar tutorial. A link to the modified file is below if you wish to just take my version else follow the below steps:

    Always make a backup of any files that you modify.

    We will be doing all our changes inside of page-user-registration.php
    I have provided some numbers that should indicate the line of code that needs to be modified but may vary from person to person.

    @Line 132 : We need to modify the line add_user_meta( $new_user_id, 'active', 'false' ); to be : add_user_meta( $new_user_id, 'active', 'false' ); this will make the user active once they register.

    @Line 133-138 : Next we need to remove the part that actually sends the email, delete the following section:
    $subject = esc_html__(‘From ‘,’arcane’).get_bloginfo();
    $message = esc_html__(“Username:”,’arcane’).” $user_id \n\n”. esc_html__(“Password: “,’arcane’). “$userpassword”;
    $message .= “\n\n”;
    $message .= esc_html__(‘Please click this link to activate your account: ‘,’arcane’);
    $message .= esc_url(get_permalink( get_page_by_path(‘user-activation’))).’?id=’.$new_user_id.’&key=’.$hash;
    $headers = ‘From: ‘.get_bloginfo().’ <‘.get_option(“admin_email”).’>’ . “\r\n” . ‘Reply-To: ‘ . $user_email;

    if (class_exists( ‘Arcane_Types’ )){
    $arcane_types = new Arcane_Types();
    $arcane_types::arcane_send_email( $user_email, $subject, $message, $headers );

    @Line 238 : We will change the message to the user: <?php esc_html_e(" Registration successful. Activation email has been sent!", "arcane"); ?> will need to be changed to: <?php esc_html_e(" Registration successful. Please Login!", "arcane"); ?>

    @239 : We will remove: <a data-email="<?php echo esc_attr($user_email); ?>" data-uid="<?php echo esc_attr($new_user_id); ?>" id="resend_activation"><i class="fas fa-retweet" aria-hidden="true"></i><?php esc_html_e(" Resend activation link!", "arcane"); ?> </a> which removes the message of “Resend activation link!”

    Here is a link to a modified version with the above changes if you would rather just copy and paste: Download

    Sorry, this forum is for verified users only. Please Login or Register to continue

Comments are closed.