How can I remove the "by [author] on [date]" in emails?

In the email sent out I'd like to just have the post excerpt, not the "by [author] on [date]" below it. There isn't a setting for this. Could that be included in future versions of this plugin? In the meantime, is there a workaround?

I'd also like to extend the length of the post excerpt in those emails. Not to a full length post, but longer than the excerpt length set by the site sending out the emails. Is there a way of doing that?

  • Michelle Shull

    Hey there, turnpiece!

    We can add this, but it will involve editing the template files for Subscribe by Email.

    To remove the author and date information, open up wp-content/plugins/subscribe-by-email/inc/mail-templates/mail-template.php

    Look for this line:

    <div <?php echo $meta_style; ?>>
    						<?php printf( __( 'by %s on %s', INCSUB_SBE_LANG_DOMAIN ), get_the_author(), get_the_date( $date_format ) ); ?>

    We're going to comment the whole thing out, like so:

    /*<div <?php echo $meta_style; ?>>
    						<?php printf( __( 'by %s on %s', INCSUB_SBE_LANG_DOMAIN ), get_the_author(), get_the_date( $date_format ) ); ?>

    Next, a few lines down from this section, you'll find the following lines:

    remove_filter( 'excerpt_more', array( &$this, 'set_excerpt_more' ), 80 );
    			remove_filter( 'excerpt_length', array( &$this, 'set_excerpt_length' ), 80 );

    Change the "80" in each of those values to the excerpt length you want to use.

    Hope this helps, Turnpiece!

  • Turnpiece

    Thanks, Michelle. On the author & date, I think it would be worth adding, or at least putting a filter in there so it can be removed or amended without having to hack the plugin itself. It's something I'm being asked to do (even though I'm trying to convince them it's good to have the author and date in there) and I suspect it's something others may want. I can edit the template but if I do that and leave it with the client and they go and update the plugin that's going to overwrite my changes.

  • Michelle Shull

    Hey there, Turnpiece!

    You're right, the changes here will be overwritten when the plugin updates. I can certainly add a feature request, if you'd rather.

    Many changes are possible without editing template code, but your particular request isn't something we could accomplish with drop-in code, like we can with a CSS-related issue.

    I can certainly add "remove author and date on newsletters" in as a feature request. The more popular an idea is among our members, the more likely it'll be added as a feature. We are limited someone in how many feature requests we can address, so we try to go for the requests that will be of the most benefit to the largest number of members.

    Thanks, Turnpiece!

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.