From 5ffd81084678c331c49ae35ad8597894598bc186 Mon Sep 17 00:00:00 2001 From: Jeremy Herve Date: Wed, 8 Jan 2014 13:07:35 +0000 Subject: [PATCH] Sharing: add Sender data to share by email This makes conversations a bit easier, since users can now reply to a shared email It also removes the default From: WordPress --- modules/sharedaddy/sharedaddy.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/sharedaddy/sharedaddy.php b/modules/sharedaddy/sharedaddy.php index cefecf75a3a9f..849a19c402eca 100644 --- a/modules/sharedaddy/sharedaddy.php +++ b/modules/sharedaddy/sharedaddy.php @@ -15,7 +15,9 @@ function sharing_email_send_post( $data ) { $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 ); + $headers[] = sprintf( 'From: %1$s <%2$s>', $data['name'], $data['source'] ); + + wp_mail( $data['target'], '['.__( 'Shared Post', 'jetpack' ).'] '.$data['post']->post_title, $content, $headers ); } function sharing_add_meta_box() { @@ -148,4 +150,4 @@ function sharing_email_check( $true, $post, $data ) { if ( defined( 'RECAPTCHA_PRIVATE_KEY' ) ) { add_action( 'sharing_email_dialog', 'sharing_email_dialog' ); add_filter( 'sharing_email_check', 'sharing_email_check', 10, 3 ); -} \ No newline at end of file +}