Display a List of Past Newsletters on a Page
In order to display a list of sent newsletters on your website, you must create a new page by going to the Pages menu of your WordPress website and then click on "Add New". Once inside the page editor, just add the shortcode below to display a list of past newsletters:
[mailpoet_archive]
All previously sent newsletters will be listed, except for:
- Autoresponder (automatic newsletter sent after an event, like a new subscription)
- Draft newsletters
- Scheduled newsletters
Filter the list of newsletters
If you do not wish to show all newsletters, there are a couple of options to limit which emails are listed. Just head to MailPoet > Settings > Basics to modify the filter as you wish:
There are six options available:
- List(s) the newsletters were sent to.
- Newsletters sent in the last X days.
- Specific time range when the newsletters were sent.
- You can choose only the start or end date or both.
- Only newsletters whose subject contains a keyword.
- Limit the number of emails shown. If there are more, they won't be shown.
Display it in your sidebar
If you want to display it in your theme's sidebar, you should install this plugin: ShortCode Widget
You should follow the same steps used to Display Total Number is Subscribers in your sidebar, just make sure to insert the archive shortcode.
Filters for modifying the look of the list
If you want to modify the date or the subject of the newsletters displayed with the shortcode, you can use the filters below. Just add the code snippet to the bottom of your theme's function.php file:
/** * Filter "mailpoet_archive_title": display custom title * @param string $title * @return string */ function my_mailpoet_archive_title($title) { return $title. 'Awesome newsletters'; } add_filter('mailpoet_archive_title','my_mailpoet_archive_title'); /** * Filter "mailpoet_archive_email_processed_date": add custom text * @param string $sent_at * @return string */ function my_mailpoet_archive_date($sent_at) { return '( <strong>Great!</strong>) '.$sent_at; } add_filter('mailpoet_archive_email_processed_date','my_mailpoet_archive_date',99); /** * Filter "mailpoet_archive_email_subject_line": add custom text * @param type $subject * @return type */ function my_mailpoet_archive_subject($subject) { return $subject. ' <== CLICK HERE'; } add_filter('mailpoet_archive_email_subject_line','my_mailpoet_archive_subject',99);
Note: DO NOT modify any of your theme files if you don't know what you are doing. MailPoet does not provide support for code customization; therefore, whatever custom shortcode you create, you are responsible for troubleshooting any issues and supporting it!