• thepeppycurator

    (@thepeppycurator)


    Hi, I am using the free plugin version and would like to customize the emails template. I managed to make some changes with the help of some support threads here, but there are still more that I am hoping to customize (if it is all possible). I copied the files to the theme’s email folder and made changes but it didn’t seem to work, so I am not sure if they are restricted. Here’s a breakdown:

    Link to screenshot: https://thepeppycurator.com/wp-content/uploads/2023/11/Screenshot-2023-11-21-at-9.36.05-AM.jpg

    1. Change the colour of the email header background. Currently it is in pink.. I am hoping to change it to a light shade of grey (#F2F2F2).
    2. For the Introductive message, is it possible for us to set the line formating? i.e.
      Hey {recipient_name},
      <br>Surprise! ?? You’ve just received a fantastic gift card from {sender}! It’s a perfect time to treat yourself! ?
    3. Next to the voucher amount, currently it is formatted as Gift Card on <Shop Name> … is it possible for us to change it to just Gift Card? It looks rather odd for it to be broken into 2 lines. Would prefer something simple with just “Gift Card” as per your screenshot samples on your site.
    4. Anyway we can amend the instructions text (“To use this gift card, …..click on the following link to automatically get the discount.”) & the text on the button (“Apply Your Gift Card Code”)
    5. The current footer is just <Shop Name>, can we customise it?

    It looks like a long list of requests, but hope you guys can help! We love the plugin and thanks!!!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support Juan Coronel

    (@juaancmendez)

    Hello there,
    we hope you’re doing well!

    1. You must change that from WooCommerce > Settings > Emails.
    2. You can configure the introductory text from WooCommerce > Settings > Emails > YITH Gift Cards – Gift Card Delivery.
    3. In order to achieve that, add the following code in the functions.php file of your active theme:
    if ( ! function_exists( 'yith_wcgc_template_product_name_text_custom' ) ) {
        function yith_wcgc_template_product_name_text_custom( $text, $object, $context, $product_id ) {
            $product = wc_get_product( $product_id );
    		$product_name_text = is_object( $product ) && $product instanceof WC_Product_Gift_Card ? $product->get_name() : esc_html__( 'Gift card', 'yith-woocommerce-gift-cards' );
            return $product_name_text;
        }
        add_filter( 'yith_wcgc_template_product_name_text', 'yith_wcgc_template_product_name_text_custom', 99, 4 );
    }

    4. Add this code too:

    if ( ! function_exists( 'yith_ywgc_email_description_text_custom' ) ) {
        function yith_ywgc_email_description_text_custom() {
            return esc_html__( 'Your custom text', 'yith-woocommerce-gift-cards' );
        }
        add_filter( 'yith_ywgc_email_description_text', 'yith_ywgc_email_description_text_custom', 99 );
    }

    Regarding the button, you can change the text from the settings of our plugin in Settings > General > Email settings > Button label.

    5. Equal to 1.

    Check it out and tell us if it works well for you, please.

    Best regards.

    Thread Starter thepeppycurator

    (@thepeppycurator)

    Thanks!! They works perfect! Can I check if there’s any chance to change the colour of the Gift Card Amount as well as the button colour too?

    Plugin Support Juan Coronel

    (@juaancmendez)

    Hello there,

    Try with this code please:

    if (!function_exists('yith_css_to_gift_card_email')) {
      add_filter('woocommerce_email_styles', 'yith_css_to_gift_card_email', 9999, 2);
      function yith_css_to_gift_card_email($css, $email)
      {
          if ($email->id == 'ywgc-email-send-gift-card') {
              $css .= '
            .ywgc-card-amount {
              color: red !important;
             }
             .ywgc-discount-link {
              background-color: red !important;
             }
         ';
          }
          return $css;
      }
    }

    Let us know any news.

    Best regards.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Customizing Emails’ is closed to new replies.