WordPress.org

Support

Support » Plugins and Hacks » [Resolved] Newsletter archive

[Resolved] Newsletter archive

  • 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/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author MailPoet
    Participant

    @wysija

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

    Plugin Author MailPoet
    Participant

    @wysija

    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,

    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.

    Plugin Author MailPoet
    Participant

    @wysija

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

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘[Resolved] Newsletter archive’ is closed to new replies.