Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Can someone help me with this? I have spent hours trying to find a way to send the featured post image along with the email sent via the email sharing button.

I know the new code to get the image goes within this line of code

function sharing_email_send_post( $data ) {
    $content = sprintf( __( '%1$s (%2$s) thinks you may be interested in the following post:'."\n\n", 'jetpack' ), $data['name'], $data['source'] );
    $content .= $data['post']->post_title."\n";
    $content .= get_permalink( $data['post']->ID )."\n";

    wp_mail( $data['target'], '['.__( 'Shared Post', 'jetpack' ).'] '.$data['post']>post_title, $content );

What is the code I need to add to this so that the featured image from the post is sent along with the post name and link?

share|improve this question
add comment

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.