• Resolved isaaccolavecchio

    (@isaaccolavecchio)


    I am hoping to change the subject of the email when you share your wishlist. Is there a way to do this?

    It currently says ‘I+wanted+you+to+see+this+site’

    Thank you

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author YITHEMES

    (@yithemes)

    I @isaaccolavecchio,

    You can customize your subject email with yith_wcwl_email_share_subject filter. Just add the following code to your customization plugin:

    
    if ( class_exists( 'YITH_WCWL' ) ) {
        if(! function_exists('yith_wcml_set_email_share_subject')) {
    	    function yith_wcml_set_email_share_subject( $subject ) {
    		    $subject = 'I wanted you to see this site';
    
    		    return $subject;
    	    }
        }
    	add_filter( 'yith_wcwl_email_share_subject', 'yith_wcml_set_email_share_subject' );
    }

    Try it and let me know.

    Have a nice day,
    Yithemes.

    • This reply was modified 6 years, 2 months ago by YITHEMES.

    Hi,
    I have added this function – it works fine but still replaces spaces with the character “+”
    Can you advice?

    Plugin Author YITHEMES

    (@yithemes)

    Hi @geraldmorales,

    Wishlist creates an URL encoded to can be compatible with most mail clients. Somes needs the “+” character and not works correctly with spaces. Anyway, you can remove this process. You only need to go to:

    yith-woocommerce-wishlist/templates/share.php:44
    file

    <a class="email" href="mailto:?subject=<?php echo urlencode( apply_filters( 'yith_wcwl_email_share_subject', $share_link_title ) )?>&body=<?php echo apply_filters( 'yith_wcwl_email_share_body', urlencode( $share_link_url ) ) ?>&title=<?php echo $share_link_title ?>" title="<?php _e( 'Email', 'yith-woocommerce-wishlist' ) ?>">

    And remove the url encode method from subject, like this:

    <a class="email" href="mailto:?subject=<?php echo apply_filters( 'yith_wcwl_email_share_subject', $share_link_title ) ?>&body=<?php echo apply_filters( 'yith_wcwl_email_share_body', urlencode( $share_link_url ) ) ?>&title=<?php echo $share_link_title ?>" title="<?php _e( 'Email', 'yith-woocommerce-wishlist' ) ?>">

    Whit this you can generate a mailto URL without “+” character on subject. But be careful, this could not works for some mail clients.

    Works perfectly – thank you for your fast and effective support.

    Plugin Author YITHEMES

    (@yithemes)

    Hello there,

    I’m glad to hear it’s working. I would like to invite you to leave a review about this plugin. You can leave a review by clicking on the following link

    Thanks in advance.

    Have a good day,
    YIThemes.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Changing Email Subject’ is closed to new replies.