Calling the API from outside the plugin
-
I’m looking to call the API from outside of the plugin (in the theme).
I am trying to call it in the following way:
$subscribed = \MailjetPlugin\Includes\MailjetApi::checkContactSubscribedToList($email, $mailjet_sync_list);
However I get the following not found message:
“Uncaught Error: Class ‘MailjetPlugin\Includes\MailjetApi’ not found in ….”
I’ve tried requiring the plugin files first, to no avail:
require_once $_SERVER[‘DOCUMENT_ROOT’]. ‘/wp-content/plugins/mailjet-for-wordpress/vendor/autoload.php’;
require_once $_SERVER[‘DOCUMENT_ROOT’]. ‘/wp-content/plugins/mailjet-for-wordpress/src/includes/MailjetApi.php’;
require_once $_SERVER[‘DOCUMENT_ROOT’]. ‘/wp-content/plugins/mailjet-for-wordpress/src/includes/Mailjet.php’;Any ideas?
- The topic ‘Calling the API from outside the plugin’ is closed to new replies.