Tell me what I'm doing wrong. I need to correct the file woocommerce/emails/plain/customer-new-account.php

An email arrives in which the link to the LC is listed as text, I want to make it clickable by adding a tag

Source:

echo sprintf( __( 'You can access your account area to view your orders and change your password here: %s.', 'woocommerce' ), wc_get_page_permalink( 'myaccount' ) ) . "\n\n";

My code is:

echo sprintf( __( 'You can access your account area to view your orders and change your password here: <a href="%s">%s</a>.', 'woocommerce' ), wc_get_page_permalink( 'myaccount' ) ) . "\n\n";

  • How are you going to send the html code <a>...</a> to plain text email? It does not work in principle. - KAGG Design
  • clearly, I did not know this, what is the option? - eugene_v 7:27 pm
  • one
    Send html mail. Select the setting in WooCommerce and use the file woocommerce/emails/customer-new-account.php - without plain. - KAGG Design
  • Thank you, I did not see that there are 2 templates, 1 for HTML, the second for Plain Text. I also thought why this switch in the admin panel. - eugene_v
  • Another close question. When registering a letter to the soap comes, and if you do a password recovery, the letter does not come. There is no spam either. - eugene_v

1 answer 1

Yes, it really works, only it was necessary to edit the file

woocommerce/emails/customer-new-account.php

<p><?php printf( __( 'Your password has been automatically generated: %s', '<p><?php printf( __( 'You can access your account area to manage your wishlist and change your password here: %s.', 'woocommerce' ), '<a href="' . wc_get_page_permalink( 'myaccount' ) . '">' . wc_get_page_permalink( 'myaccount' ) . '</a>' ); ?></p>