Automattic / Automattic/jetpack
Enhancement: Post Type and Custom Shortcodes for Post by Email
- Dominant language
- PHP
- Stars
- 1.8k
- Forks
- 898
- Avg merge
- 1d 18h
- Merged PRs (30d)
- 774
Description
### Impacted plugin
Jetpack
### What
Allow to post to a custom post type, or to create your own shortcodes to map information from a post sent from email to a custom post type
### How
Creating two new shortcodes: One for a custom post type, and one for custom post meta. This will allow those using Jetpack's Post by Email module to add extra information and better structure their website when sending over an email. Final use case at the end of this request.
# Background
The Post by Email plugin [being linked from WordPress.org](https://wordpress.org/plugins/post-by-email/) has not been updated in 10 years. Jetpack offers this feature but has limitations.
---
## Use Cases
### Post to a Custom Post Type
- [ ] Add a shortcode to create the emailed post under a registered custom post type
[Current Jetpack Shortcodes ](https://jetpack.com/support/post-by-email/#:~:text=in%20a%20post.-,Shortcodes,-Shortcodes%20can%20be) include quite a few options, but not one to set the post type when sending an email to create a post in WordPress.
---
### Use Case 2: Custom Post Meta
- [ ] Custom post meta fields sent via post by email
Add custom post meta fields when submitting a post via email, adding the meta values to the post on creation. This can be a piece of meta for a post that you have registered, or one registered by a plugin on your site. In the combined use case below, you will see this example used in tandem with Jetpack CRM.
---
### Combined Use Case: Forward an email to Jetpack CRM to attach to a user's estimate as a note.
Post to Jetpack CRM when emailing a client
___
### Shortcodes needed
[custom post type zbsc]
**zbsc** - custom post type name
[custom post meta zbsc_lastupdated EMAIL_DATE]
**EMAIL_DATE** - determined on the fly on the email client or WP side
[custom post meta wp_zbs_quotes::zbsq_notes EMAIL_BODY]
Whereas the syntax DBNAME::DBTABLE updates the post meta
**EMAIL_BODY** - Text of the email body.
Believe there is already a way attachments can be added.
---
### Links
[WordPress Codex for Post by Email](https://codex.wordpress.org/Post_to_your_blog_using_email)
- [Post by Email for Jetpack](https://jetpack.com/support/post-by-email)
- [Existing shortcodes for this module](https://jetpack.com/support/post-by-email/#:~:text=in%20a%20post.-,Shortcodes,-Shortcodes%20can%20be)
- [Outdated Post by Email plugin on WordPress.org](https://wordpress.org/plugins/post-by-email/)
- [Postie Plugin](https://wordpress.org/plugins/postie/) (linked by WP.org Codex above)
-- Does not allow custom post meta
Contributor guide
Research direction
Start by locating Jetpack's Post by Email module and its existing shortcode handling, then review the linked Post by Email shortcode documentation and the requested custom post type and post meta syntax. Done means both shortcode forms are specified and supported for emailed posts, with behavior for the combined use case verified.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- backend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100