Envoy Rest API
Envoy Rest API endpoints
by WeAreEnvoy · github.com/weareenvoy/wordpress-plugin-envoy-rest-api-email
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/weareenvoy/wordpress-plugin-envoy-rest-api-email/archive/refs/heads/main.zipThis is a WordPress Plugin. It adds the ability to create REST API routes in a controlled, contained, & repeatable way.
How do I install this plugin using composer?
Add this to your project's existing composer.json:
"repositories": [
...
{
"type": "vcs",
"url": "https://github.com/weareenvoy/wordpress-plugin-envoy-rest-api-email.git"
}
...
],
Then from the terminal, run:
composer require envoy/envoy-rest-api;
The plugin files will be placed into your project directory at:
/web/app/plugins/envoy-rest-api
Add this to your project's .gitignore:
**/plugins/envoy-rest-api
Existing API routes:
POST /wp-json/envoy/route_emails_by_state
This endpoint receives a web-browser's
contact-usform submission payload and performs the role of notifying others of the submission.\ \ Part of this role is related to a user-defined email routing table exists in the WordPress admin area. There are two important fields in the form submission that relate to looking-up appropriate contacts to route the submission to.\ \ Those fields arecategoryandstate.\ \ Thecategorywill determine if routing contacts will be read from the user-definedclaimantorprovidertable within the WordPress admin settings.\ Then within that resulting table, thestatefield will determine which of those contacts will receive copies of the email (aka 'email routing').
POST /wp-json/envoy/route_emails_by_category
This endpoint receives a web-browser's
contact-usform submission payload and performs the role of notifying others of the submission.\ \ Part of this role is related to a user-defined email routing 'category' to 'email' settings exists in the WordPress admin plugin settings for this plugin. The 'category' field in the form submission is the important field that relates to looking-up appropriate contacts to route the submission to.