MailPoet Newsletters
[resolved] Newsletter archive (5 posts)

  1. stevem
    Posted 2 years ago #

    There's a small bug in the archive. If there's an automated newsletter (eg each day, week or month) then the archive lists at the end the next activated newsletter, which of course hasn't yet been sent and has no date.

    It doesn't seem possible to use the example code in Shortcode for Archive: Filters to remove this unwanted item, as it's not possible to change the subject there.

    But it can be done in wysija-newsletters/modules/archive_std/archive_std_view.php.

    The code below works for me but please could whatever code is best be incorporated into the next update?

    Change line 120 to
    if ($newsletter->sent_at!=false){echo apply_filters('mpoet_archive_date', $newsletter->sent_at);}
    and line 126 to
    if ($newsletter->sent_at!=false){echo apply_filters('mpoet_archive_subject', $newsletter);}


  2. MailPoet
    Plugin Author

    Posted 1 year ago #

    Thanks for lettings us know about that Stevem, we'll definitely take a look at it!

  3. MailPoet
    Plugin Author

    Posted 1 year ago #

    Hello Stevem,
    What you reported is absolutely true!

    We will release the fix in the next version.
    For now, please revert your changes and apply this patch.
    The file should be located at:

    Here you go:

    Try that and let us know.

  4. stevem
    Posted 1 year ago #

    That's great and works well, thank you very much.

    That just leaves me with two customisations that I use which I'd love to see incorporated into the code or into functions.php so I don't need to change them every time MailPoet is updated:

    1. http://wordpress.org/support/topic/date-of-post-1 to allow for date of post.

    2. My weekly newsletter has a title of "Newsletter with n new posts" which is easy enough unless n = 1 when I want to use 'post' instead of 'posts'. So in wysija-newsletters/helpers/shortcodes.php I have changed [newsletter:total]. After line 244 I have added

    if ($replacement == '1') {
    		$replacement = $replacement.' new post';
    	} else {
    		$replacement = $replacement.' new posts';

    Apologies for changing the topic.

  5. MailPoet
    Plugin Author

    Posted 1 year ago #

    Thanks for these suggestions, we'll definitely take them into consideration!

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • MailPoet Newsletters
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic