.. include:: _include.rst .. _cronjob_repo_notification: ############################################################### Products Notifications Cronjob ############################################################### .. include:: _include_local_toc.rst ************ Introduction ************ Purpose ------- Use this cronjob to manually generate a |repo| notification (see :ref:`notifications`). .. note:: The cronjob only handles notifications whose recurrence is set to "Manually". .. image:: _static/recurrence_manually.png :height: 43px :width: 341px :scale: 100% :alt: recurrence manually Basics ------ To learn more about cronjobs in general, check out the :ref:`cronjobs_intro` chapter. .. _cronjob_repo_notification_setup: Setup ----- To learn more about setting up and using |asa2|'s cronjobs, see the dedicated :ref:`cronjobs_setup` chapter. ***** Usage ***** Name ---- The internal name of this cornjob is ``Asa2_Module_Notifications_Cron_RepoNotifications``. Therefore, use it with the :ref:`cronjobs_setup_serverside` execution like this: .. code:: bash script.sh Asa2_Module_Notifications_Cron_RepoNotifications And with :ref:`cronjobs_setup_wp_cron_api` and ASA2's :ref:`Cron Wrapper ` like this: .. code:: php $cronWrapper = new \Asa2\Cron\Wrapper('Asa2_Module_Notifications_Cron_RepoNotifications'); $cronWrapper->execute(); .. _cronjob_repo_notification_rest_endpoint: REST API Endpoint ----------------- The REST API endpoint name of this cronjob is |rest_api_endpoint_product_notification|. Example: .. code:: https://example.com/wp-json/asa2/v1/product-notification/?token=[your-token] Check :ref:`cronjobs_setup_rest_api` for more details about running |asa2|'s cronjobs via URL. .. _cronjob_repo_notification_recommendations: *************** Recommendations *************** Execute this cronjob as often as you want to be informed about the status of your products. Once a day is a good start. ******** Options ******** .. note:: Without options, this cronjob will execute all notifications. id ----------------- The option ``id`` is optional. It can be used to define the notifications to executed. **Possible values** - ID (integer): The ID of one notification rule you want to execute - List: A comma separated list of IDs to execute multiple notification rules at once, like: 1,2,3 You can find the ID in the first column of the notifications list table in section "Notifications". .. image:: _static/repo_notifications_id_col.jpg :height: 195px :width: 468px :scale: 100% :alt: Notifications ID .. code:: // ID example: bash script.sh Asa2_Module_Notifications_Cron_RepoNotifications -id=2 // List example: bash script.sh Asa2_Module_Notifications_Cron_RepoNotifications -id=1,2,3,5 .. image:: _static/repo_notifications_bash1.jpg :height: 90px :width: 783px :scale: 100% :alt: Notifications bash .. include:: cronjobs_options_php.inc.rst