ProcessWire Weekly #247

The 247th issue of ProcessWire Weekly features a quick walkthrough of the ProMailer module from Ryan, introduces two brand new third party modules from the folks at Blue Tomato, and showcases the ED Works website. Read on!

Welcome to the latest issue of ProcessWire Weekly! For this issue we've got some news about the latest Pro module from Ryan called ProMailer, and we're also going to take a closer look at two very interesting new third party modules: Template Engine Mustache and ElasticSearch Feeder. First one adds Mustache support to Template Engine Factory, while latter one integrates ProcessWire with the powerful ElasticSearch search engine.

(On a related note it looks like we'll be using the word "engine" a lot in this post.)

As our site of the week for this issue we're happy to introduce the latest iteration of the ED Works website. ED Works, formerly also known as ED Design, is a small design agency currently based in Germany – but we'll talk a bit more about them, and of course their new website, later.

Thanks to all of our readers for being here with us again, and as always, any feedback is most welcome – please don't hesitate to drop us a line if there's anything in your mind you'd like to share with us. Enjoy our latest issue and have a great weekend!

In the processwire.com blog this week: a closer look at the upcoming ProMailer module

In this week's blog post Ryan provides us with an in-depth introduction to his latest Pro module, known as ProMailer. We've talked about this module a few times in the past already, but I believe this is the first time we're getting a really good look at the GUI of the module, and also a proper rundown of its primary features.

ProMailer in a nutshell

ProMailer is essentially a newsletter tool for ProcessWire. It's the latest commercial Pro module from Ryan, and while it hasn't been released to the public yet, the recipients of the ProcessWire newsletter have already come in contact with it – or at least one of it's earlier iterations.

In other words ProMailer may be a new module in itself, but it's based on the code that has been powering our own newsletters for years now. Once released, the module will be able to handle everything from subscriptions (and unsubscriptions) to sending bulk messages to recipients.

There's going to be a lot of flexibility built-in, and it'll have an API you can interact with for more demanding integration needs and such.

ProMailer feature highlights

Here's a quick run-down of the primary features you'll find from the ProMailer module. For more details on each feature, check out the weekly blog post:

  • ProMailer makes it simple to create emails that originate from ProcessWire pages, from external URLs, or pasted in text and/or HTML.
  • Subscriber lists can be managed directly in ProMailer, but you can also create dynamic lists based on pages matching a selector.
  • You can create custom fields for the subscribers, as well as import and export subscribers to and from CSV files.
  • Just like ProcessWire itself, ProMailer is also built to scale with your needs. It can handle distributions of any size.
  • ProMailer provides both subscribe and unsubscribe forms, managing the entire subscribe/unsubscribe processes, while giving you full control over the output.
  • ProMailer handles the entire double opt-in process and confirmation emails – again while giving you full control over the output.
  • You can choose the WireMail module to perform each email distribution with, and you can choose how the messages are sent in terms of frequency and throttling.
  • ProMailer provides both a live send feature that you can monitor real time in the browser, and a background email distribution feature triggered by website traffic.
  • For more advanced use cases ProMailer provides a comprehensive API, which you can use to manage just about every aspect of your messages, lists, subscribers and queues.

Finally, ProMailer has been designed with ease of use in mind, and as such it will be comfortable for both you and your clients to use without breaking a sweat. All you need to do is manage your subscribers and messages via the ProcessWire admin.

For more details on the ProMailer module, including a bunch of screenshots of its GUI – subscriber management, various configuration screens, message screen, and more – be sure to checkout this week's post at the processwire.com blog. Thanks!

New module: Template Engine Mustache for Template Engine Factory

Template Engine Mustache is a brand new third party module that extends the Template Engine Factory module with support for the Mustache templating language.

Mustache claims to provide "logic-less templates", and fulfills its claim by not including even the simplest control structures, such as "if", "else", or "foreach" – although there are ways to handle similar needs with lists, inverted sections, and lambdas. For more details, check out the mustache(5) manual.

Template Engine Factory, on the other hand, is an extendable, MVC style output module for ProcessWire. It turns template files into controllers, and adds support to different templating languages to use for rendering actual markup.

To give you a basic idea how these modules work together, here's how you'd send some data to be rendered by the view:

<?php
// /site/templates/stories.php
$stories = $pages->find('template=blogstory');
$view->set('stories', $stories);

... and here's the actual view file, authored using mustache syntax:

<!-- /site/templates/views/stories.mustache -->
<h1>Stories</h1>
<ul>
    {{#stories}}
    <li>
        <a href="{{url}}">{{title}}</a>
    </li>
    {{/stories}}
</ul>

Big thanks to Markus Tiefenbacher of Blue Tomato for sharing this module with us!

For more details, check out the Template Engine Mustache GitHub repository. You can download this module directly from said repository, and you should be able to install it using ProcessWire's built-in module installer really soon – as of this writing the module is still waiting for approval at our modules directory.

New module: ElasticSearch Feeder

Our second new module for this week comes from the same dev team as the first one: developers at Blue Tomato. This module is called ElasticSearch Feeder, and it provides an easy way to integrate a ProcessWire powered website with the ElasticSearch search engine.

Before getting started with this module, you should read through some of the docs for the ElasticSearch engine itself, mainly to get a good idea of what you're doing. Getting started with the module is as simple as installing it and filling in some configuration settings, and then defining schema files for the templates you want to index.

You can find more details about the schema files from the ElasticSearch Feeder GitHub repository, but simply put they are PHP files with .shema prefix that contain a single function, which returns the data you want to store in the index – or false for pages you want to avoid indexing.

Schema files should be placed in the directory defined within module config, named after the template they apply to (news-page.schema), and contain one camelCased function, also named after the template name:

<?php
function newsPage($page, $elasticSearchFeeder, $indexPrefix) {
    if ($some_condition) {
        // don't index this page.
        return false;
    }
    $document = [
        'type' => 'news-page',
        'name' => $page->title,
        // etc.
    ];
    return $document;
}

By default data is stored after page save, and there's also a "Index All Pages" button in the module config screen. In order to make debugging easier this module includes a debug feature, which (when enabled via module config) will display indexed data after each page save. The module also supports periodically syncing data to ElasticSearch using a built-in PHP script, which is easy to run using cron or a similar solution.

For more details check out the GitHub repository. If you want to give this module a try, you can download it to your /site/modules/ directory, and/or install it directly via the ProcessWire module installer in the Admin. Big thanks to the folks at Blue Tomato for sharing this project with us!

Site of the week: ED Works

Our latest site of the week belongs to ED Works, which is a small design agency currently based in Wuppertal, Germany.

ED Works – formerly known as ED Design – is run by talented designers Erika Göbel, who was born in Siberia and grew up in Germany, and Diogo Oliveira, who originally hails from Portugal. They are well known for their unique, brilliantly simplistic design style, which always seems to find a way to surprise the viewer, and find a way to bring details to life in unexpected ways.

The ED Works website was relaunched early this year, and it's basically a one-pager, except for the privacy page. As such, most content is on the home page, with text on one column and a rather curious showcase of their works scrolling to the opposite direction on the other – definitely something that you need to see for yourself.

All in all the effect is very neat, and fits the quirky theme of the whole site really well. Project showcases open in a kind of a modal overlay, again with some interesting scroll behaviour baked in. Overall this is a truly beautiful site, and a great example of how to spark the interest of the visitor without relying on over-the-top visuals.

Diogo has shed some light on the inner workings of the site in a showcase forum post for the ED Works redesign, in which he explains that behind the scenes this website is running only a handful of third party modules: Tracy debugger, Admin on Steroids, and Admin Theme Boss. Images are being processed using ImageMagick, which has been natively supported in ProcessWire since version 3.0.10, released back in 2016.

Thanks to Erika and Diogo of ED Works for sharing their great new site with us, as well as being long time ProcessWire users and supporters. We're always happy to see more projects from you two – keep up the great work!

Stay tuned for our next issue

That's it for the 247th issue of ProcessWire Weekly. We'll be back with more news, updates, and content Saturday, 9th of February. As always, ProcessWire newsletter subscribers will get our updates a few days later.

Thanks for staying with us, once again. Hope you've had a great and productive week, and don't forget to check out the ProcessWire forums for more interesting topics. Until next week, happy hacking with ProcessWire!

Post a comment