WordPress plugin vynst Sync
Events, locations, news and media from vynst as WordPress posts, synced daily and updated instantly by webhook when they change.
vynst Sync pulls content from vynst (inwendo ERP) into your WordPress site. Every event, location, news article and media group becomes a normal WordPress post. Your theme, your search and your SEO plugins work with them like with any other post.
What is imported
| Content in vynst | becomes in WordPress |
|---|---|
| Events | Posts of the type “vynst Events” or a post type of your choice |
| Locations | Posts of the type “vynst Locations” or a post type of your own |
| News articles | Posts of the type “vynst News” with the publication date from vynst |
| Media groups and files | Posts of the type “vynst Media”, files as subpages or as a list on the group |
| Categories | Terms of the taxonomy “vynst category” (iw_vynst_unified_category) |
| Tags | WordPress tags |
Title, description, image, categories and tags go directly to the post. All other fields are stored in full in the meta field erp_all_data, and the ID from vynst is stored in erp_id. Your theme can show any field this way, such as dates, prices or the address.
The plugin only reads publicly visible content. Anything that is internal in vynst does not reach the website. It does not write anything back to vynst.
Requirements
- WordPress 5.0 or newer, PHP 8.1 or newer
- the base plugin iw-wp-utils version 1.8.1 or newer. If it is missing, vynst Sync does not start and shows no message.
- a license key from inwendo. You get plugins and keys through support.
Setup
- Upload and activate iw-wp-utils and vynst Sync.
- In the menu vynst Sync → Settings, on the tab General, enter the License Key.
- For vynst API URL, enter the address of your installation, for example
club.iw-erp.de. The plugin addshttps://itself. - Save. The connection status shows whether vynst can be reached.
- On the tabs Events, Locations, News articles and Media, choose under Local import post type where to import: the included type, another public post type, or “No local import”.
- Start the first sync with Sync events, Sync locations and so on.
Warning: If you change the target post type later, the plugin permanently deletes all posts imported so far in the old type. Your own additions to these posts will be lost.
Media
On the tab Media, you also set:
| Setting | Values |
|---|---|
| Import mode | groups only (files as a list on the group) or groups and files as their own posts |
| Import source | public groups only, private groups only, or both |
| Private Media Groups | add individual non-public groups by their token. The group is picked up at the next media sync. |
| Media file URL | path under which files are served. The default almost always fits. |
When syncing happens
| Trigger | What happens |
|---|---|
| Daily at about 3 a.m. | All enabled areas are fully synced. Anything that no longer exists in vynst is deleted in WordPress. |
| Webhook from vynst | Only the changed record is fetched again, created or deleted immediately. |
| Buttons in the settings | Full sync of one area at the click of a button. |
The daily run uses WP-Cron. On sites with little traffic, it only runs reliably if your host triggers WP-Cron regularly through a system cron job.
Deletion only happens if the list from vynst was verifiably loaded completely. If the connection breaks off, everything stays as it is.
Update instantly with webhooks
So that changes do not wait until the next morning, vynst reports them to WordPress via a webhook. For this, the plugin provides four addresses:
| Content | referenceClassName |
Address in WordPress |
|---|---|---|
| Events | BaseEvent |
https://your-website.com/wp-json/iw-vynst-sync/v1/update_events |
| Locations | BaseLocation |
…/wp-json/iw-vynst-sync/v1/update_locations |
| News articles | MediaNewsArticle |
…/wp-json/iw-vynst-sync/v1/update_news-articles |
| Media groups | MediaGroup |
…/wp-json/iw-vynst-sync/v1/update_media |
Create one webhook per content type in vynst. Enter the Plugin Token from the tab General as notificationClientToken. vynst then sends it in the header X-IW-Webhook-Token. Leave databaseAction empty. Then vynst reports creating, changing and deleting.
curl --request POST https://club.iw-erp.de/api/dw/webhook.json \
--header 'x-iw-jwt-token: <TOKEN>' \
--header 'content-type: application/json' \
--data '{
"data": {
"name": "Events to the website",
"referenceClassName": "BaseEvent",
"notificationType": "HTTP_POST",
"notificationUrl": "https://your-website.com/wp-json/iw-vynst-sync/v1/update_events",
"notificationClientToken": "<Plugin token from WordPress>"
}
}'
The plugin replies with 200 and {"message": "Success", …}. A wrong token gives 401, a record without an ID gives 400. With the webhook’s debug mode, you see the request and response in the vynst log.
A webhook only updates the one record. New categories only come with the next full sync. If you create a new category and use it right away, start a sync of the area once with the button.
Use in your theme
If you use the included post types, the posts have the archives /vynst-events/, /vynst-locations/, /vynst-news/ and /vynst-media/. The categories are under /vynst-category/. With Hide Taxonomy Page you hide the category pages.
For your own templates, there is a small PHP interface:
// All events, each with the full data from vynst
$events = IwVynstItem::getAllEvents();
// One event by its ID in vynst ('wp' for the post ID)
$event = IwVynstItem::getEventById('523', 'erp');
// A single field from the full data, in the current language
$title = IwVynstItem::getTranslatedFieldByPostId(get_the_ID(), 'public_title');
With WPML, getTranslatedField returns the translation from vynst. Otherwise it returns English, and if that is not available, German.
Good to know
- Public means public: Whatever is visible on the website in vynst is also stored in the WordPress database and in the meta field
erp_all_dataafterward. - Categories: If you switch off all imports, the plugin also removes all terms of the vynst category.
- Your own changes to imported posts are overwritten by the next sync. Maintain content in vynst.
More for WordPress
vynst Sync brings the data to your website. Your theme takes care of the display. If you need more, such as location maps, download areas, forms that write directly to vynst, or custom layouts, inwendo can develop them to suit you. Ask support for an individual offer.