Shortcodes can be embedded in your email to configure various aspects of the published post. The following shortcodes can be used when posting by email:

  • [category x,y,z]
  • [excerpt]some excerpt[/excerpt]
  • [tags x,y,z]
  • [delay +1 hour]
  • [comments on | off]
  • [status publish | pending | draft | private]
  • [slug some-url-name]
  • [title Your post title]
  • [end] – everything after this shortcode is ignored (e.g. signatures). If you use this, make sure it’s on its own line with a blank line above it.
  • [slideshow] – replaces the auto-gallery with a slideshow
  • [nogallery] – disables the auto-gallery and displays all images inline
  • [more] – see more tag
  • [nextpage] – see pagination
  • [publicize off|yahoo|twitter|facebook] – change Publicize options (see below)

Shortcodes can be included anywhere in the body of your email and must be in lowercase. There should be no spaces between the left square bracket and the shortcode content.

Adding Categories

The category shortcode allows you to add existing categories to your post, or create new categories. Categories must be comma separated.

[category holidays, main-dishes]

Note: it’s possible to add categories by matching existing category slugs. For example, ‘main-dishes’ may add the ‘Main Dishes’ category if it exists. If the ‘main-dishes’ category did not exist, however, then a new category with the slug and name ‘main-dishes’ would be created instead.

Adding Tags

As with categories, any number of tags can be added to your post, each separated by a comma. You can add existing tags, or create new ones.

[tags one potato, two potato, three potato, more]

In this example, four tags will be added to your post: ‘one potato’, ‘two potato’, ‘three potato’, and ‘more’.

Changing a Post’s Publicize settings

Jetpack’s Publicize feature lets you notify other web services about your posts. With the [publicize] shortcode you can control this from Post by Email.

Note: your Publicize settings must have been previously configured for these shortcodes to work. Importantly, if you have already configured Publicize and don’t include these shortcodes in your post, then it will be Publicized to all of your connected Publicize accounts.

The following Publicize shortcodes are available:

[publicize off] – disable all Publicize notifications.

[publicize twitter] – only send a notification to Twitter.

[publicize twitter]my new post[/publicize] – only send a notification to Twitter and set the Twitter status to my new post.

[publicize twitter facebook] – Sends a notification Facebook and Twitter only.

Note: if you use more than one [publicize] shortcode in your post (for example, both [publicize twitter] and [publicize facebook]), only the second shortcode will be used (in this case, [publicize facebook]). If you want to Publicize to only these two services, you need to use a combined shortcode, like [publicize twitter facebook].

Delaying Your Post

The delay shortcode will accept any time allowed by PHP’s strtotime function. For example, you can use the following to delay your post by one hour, or two days, respectively.

[delay +1 hour]
[delay +2 days]

Providing a post title

By default, the title of your post will be taken from the subject line of your email. In some instances, such as when sending an email from some cell phones or via a MMS-Email gateway, you may not be able to provide a subject. In these cases, you can set your post title from inside the email with a shortcode:

[title My Fancy Post]

This will set the title of your post to ‘My Fancy Post’.

Changing Your Post Status

Sometimes you may want your post to be private, or to be reviewed by yourself or someone else before being published. To do this, you can use the [status] shortcode to set the post status.

[status private]

This will post your content with a ‘private’ status.

Example Email with Shortcodes

The following email will be published in two days’ time to the “WordPress” category, with the tags “announcement” and “WordPress”:

Welcome to Post by Email, the easiest way to blog!

[tags announcement, WordPress]

[category WordPress]

[delay +2 days]

 

0
Nous aimerions avoir votre avis, veuillez laisser un commentaire.x