Newsletter archive in e-newsletter?

Hi there!

I was wondering if it is possible to create an archive of the newsletters sent by e-newsletter on the website? It should be! The data is in the database already, but how do I query it?

  • Jack Kitterhing
    • Code Norris

    Hi there @Maija

    Thanks for the additional info, Interesting idea and I believe this should be possible, but can't 100% guarantee that, I'd like to flag the lead developer on this, please note his response will be delayed as he is currently away on vacation. In the mean time I will ask some colleagues if they may have seen this done before at all :slight_smile:

    Thank you!

    Kind Regards

  • Maniu
    • Developer

    Hey @Maija

    It is possible - you would need to access newsletters class to use proper functions and generate content body.

    Calling for
    global $email_newsletter, $email_builder;
    will let you access functions...

    i believe you would need something like this to generate email body for all newsletters:

    get newsletter ids:

    $newsletters = $email_newsletter->get_newsletters();
    $example_id = $newsletters[0]['newsletter_id']

    generate body for id:

    $content = $email_newsletter->make_email_body($example_id, 1);
    $content = $this->prepare_preview($content);
    echo $content;

    hope this will point you in right direction:slight_smile:


Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.