WordPress.org

Support

Support » Plugins and Hacks » Sharing : Share by email [improvement]

Sharing : Share by email [improvement]

  • Nicolas
    Member

    @royalcas

    Hi,

    I’ve tried the sharing by email option and I would like to know if it’s possible to change the content of the email sent.

    IMHO, this email looks too much like those spammy email you receive saying. “Amazing site: spam link

    How could I change the following:
    “XXX thinks you may be interested in the following post: title + link

    and add the excerpt or meta description to give more details about the post. That’s an email not a tweet 😉

    I found this so far:

    function sharing_email_send_post( $data ) {
    	$content  = sprintf( __( '%1$s (%2$s) thinks you may be interested in the following article:'."\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 );
    }

    How do I add the excerpt for example?

    Thanks for your help.

    http://wordpress.org/extend/plugins/jetpack/

Viewing 11 replies - 1 through 11 (of 11 total)
  • Plugin Author Jeremy Herve
    Jetpack Mechanic

    @jeherve

    I like the idea! We’ll consider making some improvements to that email in a future Jetpack update.

    Yea, I second that.
    We should be able to customize that message (for other languages maybe?) and the mail subject title.

    Nicolas
    Member

    @royalcas

    Hi Jeremy,

    I’m looking forward the next update then!

    completely agree – and looking forward to the next update!

    I also would like to either

    a) change the from (currently wordPress@domain.com) email address to something I set, or

    b) have the person sending the link provide their own email address.

    All of the people I’ve shared links from my own site say the received email ends up in Junk Mail.

    Plugin Author Jeremy Herve
    Jetpack Mechanic

    @jeherve

    a) change the from (currently wordPress@domain.com) email address to something I set

    The sender address is actually the default sender address set by WordPress. You can customize it with a small function, like so:

    function jeherve_from_email( $email ) {
    	return 'youraddress@domain.com';
    }
    add_filter( 'wp_mail_from', 'jeherve_from_email' );

    hey – that’s pretty cool – thanks!

    worked nicely =)

    I’m using this one to change the mail name as well:

    function my_mail_from( $email )
    {
        return 'something@domain.com';
    }
    add_filter( 'wp_mail_from', 'my_mail_from' );
    
    function my_mail_from_name( $name )
    {
        return 'Le website name';
    }
    add_filter( 'wp_mail_from_name', 'my_mail_from_name' );

    Hi

    I need to do change the wordpress@domain.com, I see the solution above but not sure how to implement it/ what to do with the function.

    Any advice / suggestions are greatly appreciated!!

    Thanks

    Hi
    In the sharing by email option,

    does anyone have a solution to add an excerpt also to the email content being shared. In addition to the title and the link that is already there in the email content?

    Thanks

    Plugin Author Jeremy Herve
    Jetpack Mechanic

    @jeherve

    @np79 See my post above; you’ll want to add that code into a functionality plugin , or into your theme’s functions.php file.

    @ashaan That’s not possible at the moment, unless you were to edit the sharing_email_send_post function in modules/sharedaddy/sharedaddy.php in the Jetpack plugin. I would recommend against it though, since your changes will be overwritten in the next plugin update.

    As I mentioned earlier, I took note of Nicolas’s suggestion and we’ll consider improving the email in a future Jetpack update.

    Thanks!

    Thanks Jeremy. Will look forward to that update then. Very happy to have a plugin like jetpack. Appreciate your effort!

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Sharing : Share by email [improvement]’ is closed to new replies.