• Resolved leaninonlife

    (@mattchewbacca)


    Here is the problem…

    I want the usernames to be the email in the registration. Not the User’s Names.

    When I setup the plugin I choose Email for User Name and Email for Email. (there are only two fields in pro to choose from)

    However, its misinterpreting User Name for the Username as well as the User’s First and Last Names… So the Email is listed as [email protected] [email protected] as well as their username and email… So ALL of the fields are plugged in as their email address…

    Either, the plugin needs to have a third field to choose the User’s Physical Names, or something else is going on here. If I set User Name to the Name field in the form then I am unable to manually set the user’s usernames as their email address.

    I do not want my users to have to worry about an actual username. What I’m doing is a simple contact form to request info, and it automatically generates a login for the site which they can then activate if they want but I don’t want them filling out any more info than their Name, Email, and Phone number…

    Maybe there is a way to modify the plugin to achieve this goal please help!

    I have a PRO license!

    • This topic was modified 7 years, 10 months ago by bdbrown.
    • This topic was modified 7 years, 10 months ago by bdbrown. Reason: edited title
Viewing 4 replies - 1 through 4 (of 4 total)
  • As the plugin author is aware, support for commercial products is not provided on these forums. Please contact the vendor at their commercial plugin site:
    https://www.wpbuilderweb.com/product/frontend-registration-contact-form-7-pro/

    Thread Starter leaninonlife

    (@mattchewbacca)

    Thank you,

    I had to add reply-to headers to the plugin, so I just went in and reprogrammed it to take the $email variable instead of

    On line 183 I added the first snippet here:

    //Add Reply-To Header for DKIM Authentication to be Successful
    $headers .= 'Reply-To: '.$blogname.' <'.$_cf7frfrom_.'>' . "\r\n";
    $headers .= 'From: '.$blogname.' <'.$_cf7frfrom_.'>' . "\r\n";

    Then to fix the Username issue on line 37 of the opt file:

    // Construct a username from the user's email
    $username = $email;
    $name_parts = explode(' ',$name);

    Took me all of 5 minutes to find it. The developer should copy/paste (at a minimum meet today’s email best practices to prevent spam filters from tossing people’s registration information away by adding a reply-to header so that DKIM/SPF are supported on outgoing emails through the PHPMailer. Without the reply-to header its unable to authenticate the message.

    • This reply was modified 7 years, 10 months ago by leaninonlife. Reason: Removed extra whitespace
    • This reply was modified 7 years, 10 months ago by leaninonlife.
    • This reply was modified 7 years, 10 months ago by leaninonlife.
    Thread Starter leaninonlife

    (@mattchewbacca)

    Mod, if you could change the title of this post to remove the PRO tag at the end I can provide the solution for those of you on the FREE edition as well. I’m sure a lot of other people have struggled with similar problems due to the lack of options even the paid version doesn’t support as well as a way to prevent their emails from being blocked by strict firewalls.

    TO RESOLVE THE USERNAME EMAIL FIRSTNAME LASTNAME
    Conundrum and Still Allow the User’s Name to be their First and Last name and not their Email Address TWICE a quick fix without having to make any conditional statements is just to hardcode the $username to be the $email.

    Open up your plugin folder in wp-content > plugins > frontend-registration-contact-form-7 and you will see only 2 php files.

    Resolution to this problem is to navigate to line 31 of frontend-registration-opt-cf7.php (this fix is the same on both the PRO and the FREE versions except for the line number).

    And find the following:

    $username = strtolower(str_replace(' ', '', $name));

    (line 31 in FREE and line 37 in PRO)

    Replace the value of the variable with the $email variable to ensure all usernames are derived from the email address rather than removing the spaces in the $name string.

    $username = $email;

    Your code should look something like this…

    // Construct a username from the user's email
    $username = $email;
    $name_parts = explode(' ',$name);

    This works best if you have the your-name option set in the wp-admin under “Selected Field for User Name” so that the plugin knows to use the $name variable as $name_parts to explode into ‘first_name’ and ‘last_name’ during the user creation process.

    Ideally you would want to code it to have a dropdown for username and a dropdown for User’s Name (first and last) or User’s First Name and User’s Last Name individually. Then point the input of those values directly into the $userdata.

    THEN TO ALLOW SENT MAILS TO SUPPORT DKIM (PRO Only)
    You simply need to add a $header value for ‘Reply-To’ in the plugin file you just had open: frontend-registration-opt-cf7.php

    On line 183 add the new $header value like so as to include the same “sender” email as the reply-to email since there is only one field in the plugin. It doesn’t entirely fix the problem that the feature isn’t available, but it resolves the issue of authentication without having to modify the plugin’s interface as not many people have a custom reply-to and sender on email messages sent from their mail server on wordpress unless they’re actually being sent from a physical person to you.

    //Add Reply-To Header for DKIM Auth to be Successful Above the From: $header
    $headers .= 'Reply-To: '.$blogname.' <'.$_cf7frfrom_.'>' . "\r\n";
    $headers .= 'From: '.$blogname.' <'.$_cf7frfrom_.'>' . "\r\n";
    • This reply was modified 7 years, 10 months ago by leaninonlife.
    • This reply was modified 7 years, 10 months ago by leaninonlife.
    • This reply was modified 7 years, 10 months ago by leaninonlife.
    • This reply was modified 7 years, 10 months ago by leaninonlife.

    @mattchewbacca – appreciate your willingness to share your solution with the community.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘User Registration Email -> First/Last Name Glitch’ is closed to new replies.