NS Pro 4.1.3380 is out. It adds a preview button to the newsletter editor, lets a recurring newsletter wait when there is nothing new to send, and gives you more control over how articles and lists look in your emails. It also fixes a sending problem that matters on many servers. This article explains what changed, why, and what, if anything, you need to do.

An important fix for scheduled sending

NS Pro sends long newsletters in sessions, a batch at a time, and only one session per newsletter may run at once. If a session dies halfway, for example because of a PHP timeout or a server restart, NS Pro waits for the Abandoned Session Interval (NS Pro Options) and then lets a new session take over.

Since version 4.0, that waiting time was measured with two different clocks: the sending log is written in your server's local time, but it was compared against UTC. So on any server whose time zone is not UTC, the interval was off by the server's offset:

  • Servers ahead of UTC (most of Europe, Asia, Australia) waited hours longer than they should before taking over a stopped session. In Athens, a 90-minute interval became about three and a half hours. Newsletters looked stuck.
  • Servers behind UTC (the Americas) could consider a session abandoned while it was still running, and start a second one next to it, with the risk of some subscribers receiving the newsletter twice. This would require a combination of factors to happen, but it was not impossible.

Both sides now use the same clock, so the interval means what it says, wherever your server is.

Preview a newsletter before you send it

The newsletter edit screen has a new Preview button in the toolbar. It shows the newsletter exactly as it would arrive if it were sent to you: in your template, with every smart text replaced, included articles and modules filled in, and your style options applied, with the subject on top.

  • It previews what is in the editor right now, so you do not have to save first.
  • If your email address is also a subscriber, your subscriber details are used, so your name and your extra field values show up where the newsletter uses them.
  • Previewing records nothing. No open is counted and no link tracking is created.
  • A Show HTML button shows the final HTML and its size.

Until now, included modules ({include:module} and {include:moduleposition}) came out empty in test sends until the newsletter had been saved with them. They now show in previews and test sends straight away. The same goes for the style options: test sends use what is on screen, saved or not.

Only send when there is something new

A recurring newsletter built with {latest-articles} is the most hands-off newsletter you can have. But in a week with no new articles, it used to go out anyway, with an empty section where the news should be.

Add required="1" to the smart text, and that section becomes one the newsletter cannot go without:

{latest-articles ref="weekly" catids="8" required="1"}

When it finds nothing new:

  • A newsletter that repeats every few days moves on to its next date, and is checked again then. Nothing is marked as sent and no copy is made.
  • A newsletter scheduled once stays scheduled, and is checked on every run, so it goes out as soon as there is something new.
  • If you send it manually, it is not sent, and the message tells you why.

Every postponement is written to the Sending Log, and emailed to your usual notification recipients if you receive "sending completed" notifications. Newsletters without required="1" work exactly as before.

Article teasers, and articles you can edit

The Content tab of the newsletter editor has two additions for articles.

The new Article Teaser option, or {include:articleteaser}42{/include}, writes the article's title as a link, its intro text and a Read More link, in one go. It is the usual way to present a single article in a newsletter, and it no longer takes three smart texts.

The new Insert as option lets you choose between a smart text, as before, and Editable content. Editable content puts the article itself into the editor, so you can shorten it, reword it for email, or move its images, without touching the original article. For now, this is available for articles. Modules, categories and tags still insert smart texts.

More style options

The Link Styles tab of newsletters and templates is now called Styles, grouped into Links, Lists and Images, with two new options:

  • List bullets: hide or show the bullets of lists. Hiding them also removes the indent email clients add for them. It is applied when the email is built, after articles and modules are included, so it also works on lists that come from a module, where a CSS rule would often be stripped by the email client.
  • Fit images to the screen: wide images shrink to fit a phone screen, instead of making the whole newsletter wider than the screen.

Like the link options, you can set them once on a template, and every newsletter made from it follows. Lists and images that already have their own style are left alone.

Other fixes

  • Recurring newsletters set to Clear sending status and re-schedule kept sending the same {latest-articles} articles on every run. They now pick only newer articles each time.
  • Template overrides for the article layouts (article.php, article_teaser.php, article_image.php) were not being used. They now work from the same folder as the {latest-articles} layouts: templates/<your template>/html/com_nspro/layouts/.
  • Article links in newsletters now open inside your site's menu structure, using the menu item of the article or its category. This makes a big difference on multilingual sites, where these links used to have no menu item at all.

Most of this release came from requests and reports by NS Pro users. If something in your newsletter workflow takes more steps than it should, tell us about it. And as always, if anything does not work as expected after updating, let us know, and we will look into it right away.