Postie has a number of options which can be specified in the email to either override default settings or control the formatting of the post.
Note that you don’t need to do anything special to your email in order to get it to show up as a post in your WordPress. Just send an email, Postie will do the right thing.
Be sure to read the Getting Started guide.
Posts can be delayed. You can add days, hours and/or minutes to the email date to delay the publishing of a post.
Usage (in the message body):
delay: [0-99d][0-99h][0-99m]
Example
This will delay 1 day delay: 1d This will delay 1 hour delay: 1h This will delay 1 day, 2 hours and 4 minutes delay: 1d2h4m
It is possible to place images in certain places when using plain text emails by using the #img# directive in your mail text.
Example
Here is a sample plain text email.
#img1#
With an image displayed in the middle of the text.
This will generate a post with the first attached image between the two paragraphs.
The number following #img directs Postie as to which image it should use. You do not have to use them in order. I.e. you can have #img3# before #img1# in your email.
Additionally you can specify a caption like so:
Here is a sample plain text email.
#img1 caption='pretty kitty'#
With an image displayed in the middle of the text.
Note you can only use the #img# feature if your “Preferred Text Type” is set to “plain”
You can override the default comment control for the message.
Usage (in the message body):
comments: 0 | 1 | 2
0 means comments closed
1 means comments open
2 means comments from registered users only
Example
comments: 1
There are 3 different ways to specify categories in your email and they all involve the subject line.
Note the category must already be set up, Postie will not create new categories.
(although there is an AddOn that will do this now – Create Categories)
The first way is to put a category name (or partial name) or a category id then a colon (:) then the actual subject.
Usage (in the subject line):
{category name}: Real subject {category id}: Real subject {partial category name}: Real subject
The second and third ways are very similar and allow you to specify multiple categories. Enclose the category name (or partial name) or id in square brackets ([]) or between dashes (-).
Examples
[category1] [19] Real subject [1] [2] [10] Real subject [cat] Real subject -category1- -19- Real subject -1- -2- -10- Real subject -cat- Real subject
If you don’t want to make use of partial matches you can turn off the “Match short category” setting.
Custom Taxonomies
This technique also works with custom taxonomies. You may have to enable the “Force User Login” setting depending on how the taxonomies were set up.
Specifying Post Type/Post Format
If you are trying to also specify the post type/format you need to do that first, like so:
myposttype//[mycategory] my subject
You can learn more about specifying post type and post format.
Disabling Category/Taxonomy Matching
Set all of the following settings to “No”
You can specify the post format by including it as the first part of the email subject followed by forward slashes (//).
Example (in the subject line)
aside//real subject
The post title would be “real subject” and the post format will be “aside”.
Posts can have their status set to draft, publish, pending, future or private. This will override the Default Post Status set in the settings screen.
Usage (in the message body):
status: [draft | publish | pending | private | future]
Note that the future status will only be detected with Postie 1.6.18 or higher.
You can use status: future combined with date to created a scheduled post.
Example
status: draft
You can override the default tags for a post in the email.
Usage (in the message body):
tags: [, ][, ]
Example
tags: cats, funny
You can specify the post type by including it as the first part of the email subject followed by forward slashes (//).
Example (in the subject line)
customtype//real subject
The post title would be “real subject” and the post type will be “customtype”. This assumes you have a plugin or theme that added a custom post type called “customtype”.
Some SMS providers supply their own not so useful subjects when going through a SMS to email gateway. You can provide your own subject in the message body by including it on the first line surrounded by the hash symbol (#). Note that you must have “Preferred Text Type” set to “plain” to have any chance of this working.
#my subject#
The rest of my message
The subject must be on the very first line and the # character must be the first character in the message (no blank lines, spaces or html). You must also set the “Allow Subject In Mail” setting to “Yes”
By default Postie will use the date of the email as the post publish date. You can override the date in the email. You can provide an exact date with optional time or a relative date.
Usage (in the message body):
date:
Examples:
date: Apr 14, 2014 date: monday date: Jan 1, 2020 4:08pm
You can include a custom excerpt of an e-mail by putting it between :excerptstart and :excerptend
Example:
:excerptstart This is my excerpt text. :excerptend This is the main body of my post.
Images in excerpts
It is possible to include images in the excerpt even if you are using plain text emails. Wherever you want the first image insert the text “#eming1#” the second image “#eming2#” and so on. The images are numbered in the order they were attached to the email.
Example
:excerptstart This is my excerpt text. An image will go here #eming1# :excerptend This is the main body of my post.
Postie has a setting called “Tag Of Message Start” which allows you to specify some text that indicates the start of the post. This is useful when the email is coming from a mailing list and you want to automatically strip out the headers or your ISP adds unwanted text to the beginning of your emails.
There is no default value for “Tag Of Message Start” so if you want to use this feature you will need to specify a value.
If your incoming emails look like:
[This e-mail has been automatically generated.] You have one or more bugs assigned to you in the Bugzilla bug tracking system that require attention. You will get this message once a day until you've dealt with these bugs! Sample defect -> http://app.devzing.com/testopia/bugzilla/show_bug.cgi?id=1 test -> http://app.devzing.com/testopia/bugzilla/show_bug.cgi?id=2 [Test Case 2] Test Case 1
You could change the “Tag Of Message Start” to “until you’ve dealt with these bugs!” and your post will look like:
Sample defect -> http://app.devzing.com/testopia/bugzilla/show_bug.cgi?id=1 test -> http://app.devzing.com/testopia/bugzilla/show_bug.cgi?id=2 [Test Case 2] Test Case 1
Postie has a setting called “Tag Of Message End” which allows you to optionally specify some text that indicates the end of the post. This is useful when the email is coming from a mailing list and you want to automatically strip out the footers or your ISP adds unwanted text to the end of your emails.
There is no default value of “Tag Of Message End” so you will need to set one if you want to use this feature. It is not required to specify the end of the message.
So if set “Tag Of Message End” to “:end” and your message looks like:
Here is my message :end With extra stuff
Postie will remove everything after and including the “:end” resulting in a post like:
Here is my message
If your incoming emails look like:
Daily Backup of Database ( test ) Rotating last weeks Backup... removed `/var/lib/automysqlbackup/daily/test/test_2014-09-12_07h47m.Friday.sql.gz' Backup Information for /var/lib/automysqlbackup/daily/test/test_2014-09-19_07h47m.Friday.sql compressed uncompressed ratio uncompressed_name 563 1412 64.4% /var/lib/automysqlbackup/daily/test/test_2014-09-19_07h47m.Friday.sql ---------------------------------------------------------------------- Backup End Fri Sep 19 07:47:03 BST 2014 ====================================================================== Total disk space used for backup storage.. Size - Location 682M /var/lib/automysqlbackup ====================================================================== If you find AutoMySQLBackup valuable please make a donation at http://sourceforge.net/project/project_donations.php?group_id=101066 ======================================================================
You could change the “Tag Of Message End” to “If you find AutoMySQLBackup” and your post will look like:
Daily Backup of Database ( test ) Rotating last weeks Backup... removed `/var/lib/automysqlbackup/daily/test/test_2014-09-12_07h47m.Friday.sql.gz' Backup Information for /var/lib/automysqlbackup/daily/test/test_2014-09-19_07h47m.Friday.sql compressed uncompressed ratio uncompressed_name 563 1412 64.4% /var/lib/automysqlbackup/daily/test/test_2014-09-19_07h47m.Friday.sql ---------------------------------------------------------------------- Backup End Fri Sep 19 07:47:03 BST 2014 ====================================================================== Total disk space used for backup storage.. Size - Location 682M /var/lib/automysqlbackup ======================================================================
Note you can’t use “====” as the “Tag Of Message End” as Postie looks for the tag starting at the beginning of the message and will remove too much.