Download Category: addon

Category Per User AddOn

The Postie Addon for Category Per User lets you optionally assign each user a default category and/or tags that gets used when Postie receives a message from that user.

User Settings

When editing a user there is an extra section: Postie Settings

You can find this new setting at the bottom of the Edit User page.

If set, the user category will override the Postie default category for email received from this user. You can still override the category by setting the subject line.

Any tags specified here will be merged with the default tags and any specified in the email.

Administrative Settings

Activating the CpU AddOn adds a new settings panel below the Postie menu:

2016-04-21_1350

From here you can prevent the user from changing the default category, specify if you want to use categories or a custom taxonomy and specify the fallback logic.

The fallback logic requires a little explanation.

“Only FROM” – this is the default and means that Postie will only use the “from” address to look up the user to find the default category/tags.

“TO then FROM” – this setting will look through the (possibly multiple) “to” addresses and if a valid WordPress user is found then the category specified for that user is used. If a user isn’t found then the “from” user is used.

“CC then TO then FROM” – this setting starts with the (possibly multiple) “cc” addresses and moves on to the “to” then “from” stopping as soon as it finds a valid WordPress user.

“BCC then CC then TO then FROM” – this setting starts with the”bcc” address and moves on to the “cc” addresses then “to” then “from” stopping as soon as it finds a valid WordPress user.

Old Settings

These settings are for CpU versions before 2.0.1 – please do not use these settings use the settings panel above instead. If you have created these constants for a previous version please delete them and use the settings page.

Category Lockdown

You can prevent users from changing their default categories by adding the following line to the wp-config.php file.

define('POSTIE_USERCATEGORY_ADMIN', true);

Use Taxonomies

You can have Postie use a specific taxonomy rather than the categories by adding the following line to the wp-config.php file.

define('POSTIE_USERCATEGORY_TAXONOMY', 'mytaxonomy');

Multiple Inboxes/Use “TO” Address

Many people want to have their users send emails to various email addresses for different categories. You can accomplish this by having the emails forwarded to a central mailbox that Postie checks and by adding the following line to the wp-config.php file.

define('POSTIE_USERCATEGORY_USETO', true);

Version History

  • 3.0.6 – 2020-04-14 – Update Updater Library
  • 3.0.5 – 2020-03-19 – Fix crashing error
  • 3.0.4 – 2020-03-19 – Support X-Original-To header for BCC
  • 3.0.3 – 2017-03-27 – Fix tag parsing issue
  • 3.0.2 – 2017-03-25 – Remove warning when default tag is blank
  • 3.0.1 – 2017-03-15 – Add tag support, add auto-update support
  • 2.1.2 – 2016-07-27 – Fix taxonomy issue.
  • 2.1.1 – 2016-05-16 – Add compatibility for Postie 1.8.
  • 2.0.1 – 2016-04-21 – Add new settings page for easier configuration. Add fallback logic to work better with user needs.
  • 1.0.7 – 2016-03-18 – Add POSTIE_USERCATEGORY_USETO constant. Set to true to use the “TO” address rather than reply-to or from. Useful if forwarding from another account.
  • 1.0.6 – 2015-12-02 – Add POSTIE_USERCATEGORY_TAXONOMY constant. Set this to a taxonomy to use it rather than category
  • 1.0.5 – 2015-11-17 – Add POSTIE_USERCATEGORY_ADMIN constant. Set to true to prevent users from changing their own default category.
  • 1.0.4 – 2015-09.08 – Allow subject line category to override the user category (requires Postie 1.7.8+)
  • 1.0.3 – 2015.08.24 – Added fallback to use reply-to if author can’t be found
  • 1.0.2 – 2015.07.10 – bug fixes
  • 1.0.1 – 2015.04.17 – bug fixes
  • 1.0.0 – 2015.04.10 – initial release

Clean HTML AddOn

The Clean HTML AddOn takes the HTML embedded in your email and cleans it up and makes sure it is W3C compliant so that it won’t cause any issues with your blog. Saves hours of time fiddling with your posts.

Configuration

This is optional. If you leave everything blank the AddOn still makes your HTML W3C compliant.

There is a configuration page that allows you to set commonly used settings.

2016-02-09_1446

Allowed is the comma separated list of HTML elements you want to allow. By default everything is allowed. If you enter anything in this setting you have to enter all the elements you want to allow. This is very restrictive. Typically you’ll want to use Forbidden Elements.

Forbidden Elements is the comma separated list of HTML elements you want to remove. By default nothing is forbidden. For example if you wanted to prevent images you would enter “img”

Forbidden Attributes is the comma separated list of HTML attributes you want to remove. For example if you change Forbidden Attributes to “style,class” then all style and class attributes will be removed.

Remove Empty will remove any HTML elements that have no content such as <span></span>

Remove Empty Remove Nbsp will remove any HTML elements that have no content other than standard and nonbreaking (nbsp) spaces. E.g. <span>&nbsp; </span>

Programmer Stuff

The Clean HTML AddOn settings page will handle most people’s needs, but if you need something additional read on.

This AddOn has one filter called “postie_htmlcleaner_config” which allows you the opportunity to modify the configuration.

Create a file named filterPostie.php in the wp-content directory and paste the following code into it:

For example this will remove all style and class attributes from the incoming email.

<?php
add_filter('postie_htmlcleaner_config', 'my_htmlcleaner_config');

function my_htmlcleaner_config($config)
{
    $config->set('HTML.ForbiddenAttributes', 'class,style');
    return $config;
}

This example this will only allow <b>, <u>, <div>, <p> and <a>. The <a> will also allow the href attribute

<?php
add_filter('postie_htmlcleaner_config', 'my_htmlcleaner_config');

function my_htmlcleaner_config($config)
{
    $config->set('HTML.Allowed', 'a[href],b,u,div,p');
    return $config;
}

Internally this AddOn uses HtmlPurifier. See http://htmlpurifier.org/live/configdoc/plain.html for all the options.


A user asked if this AddOn will clean up the “junk” MS Word and MS Outlook add. It does clean up the Word/Outlook junk, but I will say that some of what Word adds is valid html (such as class and style attributes) so you need to see what styles your theme provides that conflicts with what comes with the email.For example here is something that was from Outlook and was cleaned, but didn’t display quite the way the user wanted:

<p class="MsoNormal" style="text-align: center;" align="center"><span style="font-size: 12pt; font-family: 'Times New Roman', serif;">BOARD OF DIRECTORS MEETING</span></p>

This is valid html, but if your theme has a “MsoNormal” style defined things might look strange. Note also that a lot of specific styling was specified which might look odd in your theme especially the “font-size: 12pt; font-family: ‘Times New Roman’, serif”

Polylang AddOn

Polylang is a great WordPress plugin for adding multiple languages to your site. This addon will allow you to tell Polylang which languages are in your email.

There are 2 approaches for using this AddOn:

  • Multiple languages in a single email
  • One language per email

The following examples assume you have installed Polylang and set up both English and Deutsch as the supported languages with English being the default language.

Multiple languages via shortcode

[plpost lang=language_code <title=title>]<post>[/plpost]

There are 2 parameters:

  • lang which is the 2 character language code.
  • title which is the optional title. Typically the translated version of the title. If no title is provided the email subject line will be used.

Between [plpost] and [/plpost] is the content of the post in the language specified. For best results place these shortcodes on their own line with no formatting.

For example in a single email:

[plpost lang=de title="Erster Beitrag"]
Dies ist mein erster Beitrag.
[/plpost]

[plpost lang=en title="First post"]
This is my first post.
[/plpost]

Of course you can send a single language this way if you’d like.

One language via subject line

You can send emails that have the subject: “[de] Hier ist ein post” and Postie will automatically update the post to specify Deutsch (German) as the post language.

Please note if specify the full name (Deutsch) rather than the code (de) Postie will try to assign the post to a Polylang custom taxonomy and things won’t work as expected.

Release Notes

3.0.6 released 2021-09-01

  • category translations are now applied if available

3.0.5 released 2021-04-29

  • fix subject line detection

3.0.4 released 2020-03-04

  • switch to postie_register_shortcode_pre

3.0.3 released 2020-02-19

  • convert to class

3.0.2 released 2020-02-19

  • Associate all translated posts together

3.0.1 released 2020-02-19

  • Add plpost shortcode to allow multiple languages in a single post

2.0.2 released 2016-12-30

  • Added compatibility with older versions of PHP

2.0.1 released 2016-12-19

  • Added support for Polylang 2.0

1.0.1 released 2014-09-23

  • Initial release

Geolocation Plus AddOn

The Geolocation Plus AddOn allows you to add a latitude & longitude to a post in a way that works with the Geolocation and Geolocation Plus plugins.

WARNING: The Geolocation Plus plugin has not been updated in a long time and currently is incompatible with Google Maps. At this time I recommend using Open Street Maps. See Open Street Maps AddOn

Once installed Postie will recognize any geolocation information embedded in attached images and videos which most smartphones automatically do. Note that there is a bug in some versions of PHP that prevents this from working (currently 5.6.24-7.0.14 don’t work https://bugs.php.net/bug.php?id=73004). Note that if you have multiple attachments the plugin will use the location from the last one it processes.

Alternate Way

Alternatively you can supply some special text in your email:
{{location <latitude> <longitude>}}

For example:

We have finally arrived in Portland, Oregon!

{{location 45.52 122.6819}}

geolocation

Sample post with geolocation tag

Release History:

1.1.8 – 2017-06-28

  • Add support for postie_file_added_pre action so that we extract GPS info before the other WP actions have a opportunity to modify the file.

1.1.7 – 2017-06-16

  • Video: getID3 change to support ‘loci’ atoms
  • Video: use com.apple.quicktime.location.ISO6709 atom if exists

1.1.6 – 2017-05-17

  • Fix bug where full path to file wasn’t used

1.1.5 – 2017-03-30

  • Add autoupdater

1.1.4 – 2016-08-31

  • Updated getID3 library

1.1.3

  • Support alternate geolocation encodings

1.1.2

  • Supports video files

1.1.1

  • Explicitly checks that either Geolocation or Geolocation Plus is installed

1.1.0

  • Now extracts geolocation information from image attachments when available.

1.0.1

  • Initial public release

 

Images Only AddOn

This AddOn removes all text and uses the image template you set up in Postie for all attached images. Great for photo blogs. That’s all it does, no setup required or available.

Open Street Maps AddOn

The Open Street Maps AddOn allows you to add a latitude & longitude to a post in a way that works with the Open Street Maps plugin (OSM).

The simplest way is to attach an image or video to your email that has geolocation information embedded in it.

You can display a map of all your geo-tagged posts as described here: http://wp-osm-plugin.hanblog.net/geotag-posts-and-display-map-with-geotags/

Alternate Way

Alternatively you can supply some special text in your email:
{{location <latitude> <longitude>}}

For example:

We have finally arrived in Portland, Oregon!

{{location 45.52 -122.6819}}

Release History:

1.1.9 – 2017-06-28

  • Add support for postie_file_added_pre action so that we extract GPS info before the other WP actions have a opportunity to modify the file.

1.1.8 – 2017-06-20

  • getID3 update
  • Video: Use com.apple.quicktime.location.ISO6709 atom if exists
  • Fix pathing issue

1.1.7 – 2017-04-10

  • Fix issue when handling {{}} syntax in OSM 3.6+

1.1.6 – 2017-04-06

  • Updates to support OSM 3.6
  • More robust fallback EXIF handling

1.1.5 – 2017-04-06

  • Alternate logic for getting geolocation for broken versions of PHP.
  • Autoupdate

1.1.4 – 2017-03-30

  • Updated getID3 library to 1.9.14

1.1.3 – 2016-08-31

  • Update getID3 library to 1.9.12

1.1.2 – 2015-12-09

  • Support alternate geolocation encodings

1.1.1 – 2015-11-24

  • Add support for geolocating videos

1.1.0 – 2015-07-07

  • Now extracts geolocation information from image attachments when available.

1.0.2

  • Better support for unicode characters

1.0.1 – 2015-07-07

  • Initial public release