PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Wednesday, December 29, 2021

[FIXED] Customization of new account email template in woocoommerce

 December 29, 2021     php, woocommerce, wordpress, wordpress-theming     No comments   

Issue

I am trying to add header & footer image in New account mail template in woocoomerce. Default template of new account is as follow

enter image description here

I am trying to add header & footer in this template only.(image attached for better clarification)

enter image description here

Issue - Added Images are not showing in user's mail box.

What i have tried -

I copied the customer-new-account.php file to my child theme folder & added the image. But it does not showing the image in. Path of file -

my-child-theme/woocommerce/emails/customer-new-account.php.

My custom code is -

 defined( 'ABSPATH' ) || exit;

do_action( 'woocommerce_email_header', $email_heading, $email ); ?>

<img src= 'Path of header image'>


<?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 ) ) );
}

<img src= 'Path of footer image'>

do_action( 'woocommerce_email_footer', $email );

Any Advice ?


Solution

There was issue with https and http. The SSL-certificate was expired for the domain I was working on.

Due to this image was not displaying in user's mailbox. After fixing the SSL issue everything started working.



Answered By - Siddharth
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home
View mobile version

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing