0

Hi I am trying the below code form Adding an image near the footer on WooCommerce completed orders email notification

However, cannot figure out how I can add a link to the image to create hyperlink like a src in html. Any ideas please?

add_action( 'woocommerce_email_customer_details', 'custom_image_near_email_footer' , 50, 4);
function custom_image_near_email_footer( $order, $sent_to_admin, $plain_text, $email ) {
    // For customer order notification with "completed" status
    if ( 'customer_completed_order' == $email->id )
        echo '<div style="text-align:center;">
            <img src="'.home_url( "image.png" ).'" alt="image"/>
        </div>';
}
Visdem
  • 1
  • 1

1 Answers1

0

Resolved this by adding "a href="google.com"

add_action( 'woocommerce_email_customer_details', 'custom_image_near_email_footer' , 50, 4);
function custom_image_near_email_footer( $order, $sent_to_admin, $plain_text, $email ) {
    // For customer order notification with "completed" status
    if ( 'customer_completed_order' == $email->id )
        echo '<div style="text-align:center;">
            <a href="google.com"><img src="'.home_url( "image.png" ).'" alt="image"/>
        </div>';
}

Visdem
  • 1
  • 1
  • make sure you include `https://`. As it stands, it *might* work in some email clients, but not all of them – Nathan Sep 27 '22 at 02:16