• Resolved wordpressuser0012

    (@wordpressuser0012)


    Hello,

    Is it possible if i activated the verification email to be combined with the account creation email, instead of append the original wc customer_new_account to be above?

    Thanks in advance!

Viewing 11 replies - 1 through 11 (of 11 total)
  • Plugin Author WPFactory

    (@wpcodefactory)

    Hello @wordpressuser0012 ,

    Sorry for the delay.
    What would be the account creation email? Is it from WooCommerce or WordPress?

    Thread Starter wordpressuser0012

    (@wordpressuser0012)

    Sorry for the late reply, i haven’t received any notification about the reply.

    It’s from WooCommerce.

    Thread Starter wordpressuser0012

    (@wordpressuser0012)

    @wpcodefactory any process?

    Thanks in advance.

    Plugin Author WPFactory

    (@wpcodefactory)

    Hi,

    I’m sorry but I still don’t know what is the “account creation email”.
    Wouldn’t it be exactly the “customer_new_account” email that we are using?

    Can you please try to explain it to me with more details?

    Thread Starter wordpressuser0012

    (@wordpressuser0012)

    Hello again,

    Sorry if my description is not clear enough. Let me try explain the flow.

    When somebody registers he receives an email with his password from woocommerce.
    I have activated your plugin and activated the option user has to verify his email
    and also the email he receives to be 1 email. Account registration and email verification

    Hopefully until now is clear.

    Now when he receives the email it goes like this.

    <strong>Hi ....,
    
    Thanks for creating an account on ....
    
    USERNAME: sample_username
    
    PASSWORD: ******
    
    To change your password, and edit your profile please visit: https://..../my-account/
    
    Please click the following link to verify your email:
    
    https://..../my-account/?alg_wc_ev_verify_email=....
    
    We look forward to seeing you soon.</strong>

    So as i can guess the part of please click the following… comes from your plugin.

    Is there any possibility to switch the position and display as:

    Hi ....,
    
    Thanks for creating an account on ....
    
    Please click the following link to verify your email:
    
    https://..../my-account/?alg_wc_ev_verify_email=....
    
    USERNAME: sample_username
    
    PASSWORD: ******
    
    To change your password, and edit your profile please visit: https://..../my-account/
    
    We look forward to seeing you soon.

    So the verification link comes above the account details.

    In case that’s still unclear let me know.

    Plugin Author WPFactory

    (@wpcodefactory)

    Hi @wordpressuser0012,

    There are 2 solutions.

    1) Edit the templates/emails/customer-new-account.php from WooCommerce and move the above code to the position you want. This is where we’re displaying the activation message:

    
    if ( $additional_content ) {
    	echo wp_kses_post( wpautop( wptexturize( $additional_content ) ) );
    }

    2) If you don’t want to move it as it can possibly cause issues with other plugins I’ve created a new option for you:
    – Advanced > Fine tune activation email placement

    After it’s enabled you also need to modify the email template, but all you have to do is to place this code where you’d like to display the activation message:
    do_action( "alg_wc_ev_activation_email_content_placeholder", $email->object );

    And finally, the best way to change the email template is by copying it to your theme or even a child theme.

    And the new option I created for you is available on version 2.0.4.
    Let me know if it helps ??

    Thread Starter wordpressuser0012

    (@wordpressuser0012)

    Thank you for your reply and time by adding this as a new feature!

    That worked out very well.

    Thanks again! @wpcodefactory

    Plugin Author WPFactory

    (@wpcodefactory)

    Great! Thanks for letting me know.

    In that case, please consider leaving a review if you are enjoying the plugin/support. It would be much appreciated ??

    Thread Starter wordpressuser0012

    (@wordpressuser0012)

    Of course, review has been made

    Thank you again!

    Hello. I just installed your plugin and it’s working great. However I too would like to change where the confirmation text and link appears in the welcome email.

    I’ve checked “Choose precisely where the activation email will be appended to the “Customer new account” email” and tried adding the recommended code to a copy of the templates/emails/customer-new-account.php in my child theme:

    do_action( “alg_wc_ev_activation_email_content_placeholder”, $email->object );

    Unless I place it at the very top, it either doesn’t show or it causes a fatal error. I spent a few hours on it so I’m sure my syntax is wrong somewhere.

    I know the file in my child theme is working as I can change the other text and see it displayed in the welcome email, but I just can’t sort out exactly how to add your code snippet so that it appears where I want it.

    I would simply like the “Please click on the following link” and the link itself to appear directly after the salutation “Hi username”

    Below is the original php code. Would you be so kind as to update it with the exact code to accomplish this?

    Thanks very much!

    defined( 'ABSPATH' ) || exit;
    
    do_action( 'woocommerce_email_header', $email_heading, $email ); ?>
    <?php /* translators: %s: Customer username */ ?>
    <p><?php printf( esc_html__( 'Hi %s,', 'woocommerce' ), esc_html( $user_login ) ); ?></p>
    <?php /* translators: %1$s: Site title, %2$s: Username, %3$s: My account link */ ?>
    
    <p><?php printf( esc_html__( 'Thanks for creating an account on %1$s. Your username is %2$s. You can access your account area to view orders, change your password, and more at: %3$s', 'woocommerce' ), esc_html( $blogname ), '<strong>' . esc_html( $user_login ) . '</strong>', make_clickable( esc_url( wc_get_page_permalink( 'myaccount' ) ) ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></p>
    <?php if ( 'yes' === get_option( 'woocommerce_registration_generate_password' ) && $password_generated ) : ?>
    	<?php /* translators: %s: Auto generated password */ ?>
    	<p><?php printf( esc_html__( 'Your password has been automatically generated: %s', 'woocommerce' ), '<strong>' . esc_html( $user_pass ) . '</strong>' ); ?></p>
    <?php endif; ?>
    
    <?php
    /**
     * Show user-defined additional content - this is set in each email's settings.
     */
    if ( $additional_content ) {
    	echo wp_kses_post( wpautop( wptexturize( $additional_content ) ) );
    }
    
    do_action( 'woocommerce_email_footer', $email );
    • This reply was modified 3 years, 9 months ago by richsadams.
    • This reply was modified 3 years, 9 months ago by richsadams. Reason: Update code
    • This reply was modified 3 years, 9 months ago by richsadams. Reason: Typo

    So I’ll answer my own support request.

    Instead of “prepending” or moving the plugin’s text and link in the /woocommerce/templates/emails/customer-new-account.php file, I ended up re-writing the the file itself. (The new file is located in the child theme.)

    I removed the “My Account” link and reworded it so that there’s no confusion about what to do… click on the verification link (which takes them to the My Account page anyway). Done.

    I unchecked the “Choose precisely where the activation email will be appended to the “Customer new account” email” box in the plugin’s Advanced section since I’m not actually moving the code to a new location.

    It’s working perfectly but if you see any issues with the code, please let me know so that I can update it!

    defined( 'ABSPATH' ) || exit;
    
    do_action( 'woocommerce_email_header', $email_heading, $email ); ?>
    <?php /* translators: %s: Customer username */ ?>
    <p><?php printf( esc_html__( 'Welcome!', 'woocommerce' ), esc_html( $user_login ) ); ?></p>
    <?php /* translators: %1$s: Site title, %2$s: Username, %3$s: My account link */ ?>
    
    <p><?php printf( esc_html__( 'Thanks for creating an account at %1$s. Please click on the link at the bottom of this email to activate your account. After confirming your email you can view your orders, add your address, phone and more. Later just log in with your email, %2$s, and password for super-fast checkout!', 'woocommerce' ), esc_html( $blogname ), '<strong>' . esc_html( $user_login ) . '</strong>', ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></p>
    <?php if ( 'yes' === get_option( 'woocommerce_registration_generate_password' ) && $password_generated ) : ?>
    	<?php /* translators: %s: Auto generated password */ ?>
    	<p><?php printf( esc_html__( 'Your password has been automatically generated: %s', 'woocommerce' ), '<strong>' . esc_html( $user_pass ) . '</strong>' ); ?></p>
    <?php endif; ?>
    
    <?php
    /**
     * Show user-defined additional content - this is set in each email's settings.
     */
    if ( $additional_content ) {
    	echo wp_kses_post( wpautop( wptexturize( $additional_content ) ) );
    }
    
    do_action( 'woocommerce_email_footer', $email );

    P.S. This is a bit of a double-post. Apologies. Hopefully it may help anyone else that comes along though.

    • This reply was modified 3 years, 9 months ago by richsadams.
Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Prepend customer_new_account’ is closed to new replies.