WordPress.org

Ready to get started?Download WordPress

Forums

MailPoet Newsletters
[resolved] Newsletter archive (5 posts)

  1. stevem
    Member
    Posted 2 months 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);}

    https://wordpress.org/plugins/wysija-newsletters/

  2. MailPoet Staff
    Member
    Plugin Author

    Posted 3 weeks ago #

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

  3. MailPoet Staff
    Member
    Plugin Author

    Posted 3 weeks 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:
    \wp-content\plugins\wysija-newsletters\modules\archive_std\archive_std_model.php

    Here you go:
    https://www.dropbox.com/s/kblymm61b55cz8t/archive_std_model.php

    Try that and let us know.
    Cheers,

  4. stevem
    Member
    Posted 3 weeks 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 Staff
    Member
    Plugin Author

    Posted 3 weeks ago #

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

Reply

You must log in to post.

About this Plugin

About this Topic

Tags