Wysija newsletters archiving (5 posts)

  1. matby2k4
    Posted 2 years ago #

    Hi all,

    I am in the process of producing a wordpress site for a customer and they want to be able to ping out newsletter easily from the dashboard using 'drag and drop.'All well and simple using the wysija plugin BUT the issue i am having is that they want some sort of archiving system for these newsletters so that the viewer can look up previous newsletters which have been sent out on the website.

    I was wondering if anyone has any ideas of how i will go about this. maybe there is a Plugin?


  2. AJ
    Posted 2 years ago #

    I'm working on this also...
    So far here's what I have:
    Using the 'view the html version' of the newsletter link you can include a single newsletter in a page template like this:

     * Returns the body content of the specified HTML file.
     * Strips everything outside the body tag.
     * @param string $filename
     * @return string
    function getbody($filename) {
      $file = file_get_contents($filename);
      $bodypattern = ".*<body>";
      $bodyendpattern = "</body>.*";
      $noheader = eregi_replace($bodypattern, "", $file);
      $noheader = eregi_replace($bodyendpattern, "", $noheader);
      return $noheader;
    <?PHP  echo getbody("yoursiteure.com/?wysija-page=1&controller=email&action=view&email_id=3&wysijap=subscriptions");

    The next step is to create a loop that cycles through the 'email_id=' checks for something there and returns them consecutively. In my case I would like to return the latest one in full and list links to the rest.

    I'm not great at php, anyone have any suggestions?

  3. AJ
    Posted 2 years ago #

    On second thought... an easier approach for a Wysija newsletter archive.

    I decided instead to create the post category 'Newsletter', then set Wysija to automatically send when a new post is published in that category.

    I then created a custom page template for that category so it shows the full content for the most recent Newsletter post and excerpts for the rest.

    The cool thing is that multiple newsletter categories can be created to match multiple lists and with custom page templates each one can have an archive.

    Sooo much simpler than messing around the code...

  4. luisfel
    Posted 1 year ago #

    please permaculturetreegeek, how did you set Wysija to automatically send when a new post is published in that category?

    I'm traing to use wysija solution [wysija_archive] with no result :(


  5. AJ
    Posted 1 year ago #

    When you create a newsletter/email the option to send automatically is the first radio option. When you get to the next screen edit the automatic latest content and select your category.

Topic Closed

This topic has been closed to new replies.

About this Topic