Support » Plugin: Jetpack by WordPress.com » Edit subject line in sharing emails

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Contributor Richard Archambault

    (@richardmtl)

    Happiness Engineer

    Hi! The only way to modify this currently is by editing the plugin file directly, here:

    https://github.com/Automattic/jetpack/blob/4ba5207a2d833238b342d523e758bd90efb45cb9/modules/sharedaddy/sharedaddy.php#L54

    You’ll have to redo the edit on every Jetpack update, though.

    I have opened an enhancement request here to find a way for site owners to filter the subject line with a custom function instead of editing the theme files:

    https://github.com/Automattic/jetpack/issues/8165

    cancrime

    (@cancrime)

    Thanks so much for the quick reply.

    Can I simply remove that entire line of code from the plugin file?

    Rob

    Plugin Contributor Richard Archambault

    (@richardmtl)

    Happiness Engineer

    No, removing that line will break it, no emails will be sent. 🙂

    The only part you can and should edit in the line:

    wp_mail( $data['target'], '[' . __( 'Shared Post', 'jetpack' ) . '] ' . $title, $content, $headers );

    are the words Shared Post; you can’t even change the ‘ marks around it. Editing anything else will break it.

    cancrime

    (@cancrime)

    Richard

    Thanks so much for this.

    This small tweak has fixed a problem that has literally taken weeks to debug and correct.

    I removed the words “Shared post” from that line of code, so the email with the shared post looks a bit odd, like this

    “[]Title of post shared by email”

    …but it finally works for me.

    thanks again

    Plugin Contributor Richard Archambault

    (@richardmtl)

    Happiness Engineer

    You can try editing it a bit more to remove the [] even, but be careful with what you edit as you could bring down your site. Also, I want to reiterate that any edits you make will need to be re-done the next time you update Jetpack.

Viewing 5 replies - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.