Skip to content

docs: updated documentation for Configuration component. #237

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: 5.x
Choose a base branch
from
Open
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
213 changes: 212 additions & 1 deletion docs/plugins/config.rst
Original file line number Diff line number Diff line change
Expand Up @@ -699,4 +699,215 @@

.. note:: The default value must match the value's type for Mautic to typecast and transform appropriately. For example, if there isn't a specific default value to declare, define an empty array, ``[]``, for an array type; zero, ``0``, for an integer type; ``TRUE`` or ``FALSE`` for boolean types; and so forth. Services leveraging parameters should accept and handle ``NULL`` for integer and string types, excluding ``0``.

.. note:: Parameters aren't exposed to the UI by default. See :ref:`components/config:Configuration` for more information.
.. note:: Parameters aren't exposed to the UI by default. See :ref:`components/config:Configuration` for more information.

Check warning on line 702 in docs/plugins/config.rst

View workflow job for this annotation

GitHub Actions / prose

[vale] reported by reviewdog 🐶 [Mautic.FeatureList] Is this referring to a Mautic feature? If so, use 'Components' instead of 'components'. Raw Output: {"message": "[Mautic.FeatureList] Is this referring to a Mautic feature? If so, use 'Components' instead of 'components'.", "location": {"path": "docs/plugins/config.rst", "range": {"start": {"line": 702, "column": 69}}}, "severity": "INFO"}

Check warning on line 702 in docs/plugins/config.rst

View workflow job for this annotation

GitHub Actions / prose

[vale] reported by reviewdog 🐶 [Mautic.FeatureList] Is this referring to a Mautic feature? If so, use 'Components' instead of 'components'. Raw Output: {"message": "[Mautic.FeatureList] Is this referring to a Mautic feature? If so, use 'Components' instead of 'components'.", "location": {"path": "docs/plugins/config.rst", "range": {"start": {"line": 702, "column": 69}}}, "severity": "INFO"}

Check warning on line 702 in docs/plugins/config.rst

View workflow job for this annotation

GitHub Actions / prose

[vale] reported by reviewdog 🐶 [Mautic.FeatureList] Is this referring to a Mautic feature? If so, use 'Components' instead of 'components'. Raw Output: {"message": "[Mautic.FeatureList] Is this referring to a Mautic feature? If so, use 'Components' instead of 'components'.", "location": {"path": "docs/plugins/config.rst", "range": {"start": {"line": 702, "column": 69}}}, "severity": "INFO"}

Check warning on line 702 in docs/plugins/config.rst

View workflow job for this annotation

GitHub Actions / prose

[vale] reported by reviewdog 🐶 [Mautic.FeatureList] Is this referring to a Mautic feature? If so, use 'Components' instead of 'components'. Raw Output: {"message": "[Mautic.FeatureList] Is this referring to a Mautic feature? If so, use 'Components' instead of 'components'.", "location": {"path": "docs/plugins/config.rst", "range": {"start": {"line": 702, "column": 69}}}, "severity": "INFO"}


Custom config parameters
************************
You can define custom configuration parameters in your plugin to support configurable features, such as enabling or disabling functionality.

Check warning on line 707 in docs/plugins/config.rst

View workflow job for this annotation

GitHub Actions / prose

[vale] reported by reviewdog 🐶 [Mautic.FeatureList] Is this referring to a Mautic feature? If so, use 'Plugin' instead of 'plugin'. Raw Output: {"message": "[Mautic.FeatureList] Is this referring to a Mautic feature? If so, use 'Plugin' instead of 'plugin'.", "location": {"path": "docs/plugins/config.rst", "range": {"start": {"line": 707, "column": 56}}}, "severity": "INFO"}

Check failure on line 707 in docs/plugins/config.rst

View workflow job for this annotation

GitHub Actions / prose

[vale] reported by reviewdog 🐶 [Vale.Terms] Use 'Plugin' instead of 'plugin'. Raw Output: {"message": "[Vale.Terms] Use 'Plugin' instead of 'plugin'.", "location": {"path": "docs/plugins/config.rst", "range": {"start": {"line": 707, "column": 56}}}, "severity": "ERROR"}

Check warning on line 707 in docs/plugins/config.rst

View workflow job for this annotation

GitHub Actions / prose

[vale] reported by reviewdog 🐶 [Google.WordList] Use 'capability' or 'feature' instead of 'functionality'. Raw Output: {"message": "[Google.WordList] Use 'capability' or 'feature' instead of 'functionality'.", "location": {"path": "docs/plugins/config.rst", "range": {"start": {"line": 707, "column": 127}}}, "severity": "WARNING"}

Check warning on line 707 in docs/plugins/config.rst

View workflow job for this annotation

GitHub Actions / prose

[vale] reported by reviewdog 🐶 [Mautic.FeatureList] Is this referring to a Mautic feature? If so, use 'Plugin' instead of 'plugin'. Raw Output: {"message": "[Mautic.FeatureList] Is this referring to a Mautic feature? If so, use 'Plugin' instead of 'plugin'.", "location": {"path": "docs/plugins/config.rst", "range": {"start": {"line": 707, "column": 56}}}, "severity": "INFO"}

Check failure on line 707 in docs/plugins/config.rst

View workflow job for this annotation

GitHub Actions / prose

[vale] reported by reviewdog 🐶 [Vale.Terms] Use 'Plugin' instead of 'plugin'. Raw Output: {"message": "[Vale.Terms] Use 'Plugin' instead of 'plugin'.", "location": {"path": "docs/plugins/config.rst", "range": {"start": {"line": 707, "column": 56}}}, "severity": "ERROR"}

Check warning on line 707 in docs/plugins/config.rst

View workflow job for this annotation

GitHub Actions / prose

[vale] reported by reviewdog 🐶 [Google.WordList] Use 'capability' or 'feature' instead of 'functionality'. Raw Output: {"message": "[Google.WordList] Use 'capability' or 'feature' instead of 'functionality'.", "location": {"path": "docs/plugins/config.rst", "range": {"start": {"line": 707, "column": 127}}}, "severity": "WARNING"}

Check warning on line 707 in docs/plugins/config.rst

View workflow job for this annotation

GitHub Actions / prose

[vale] reported by reviewdog 🐶 [Mautic.FeatureList] Is this referring to a Mautic feature? If so, use 'Plugin' instead of 'plugin'. Raw Output: {"message": "[Mautic.FeatureList] Is this referring to a Mautic feature? If so, use 'Plugin' instead of 'plugin'.", "location": {"path": "docs/plugins/config.rst", "range": {"start": {"line": 707, "column": 56}}}, "severity": "INFO"}

Check failure on line 707 in docs/plugins/config.rst

View workflow job for this annotation

GitHub Actions / prose

[vale] reported by reviewdog 🐶 [Vale.Terms] Use 'Plugin' instead of 'plugin'. Raw Output: {"message": "[Vale.Terms] Use 'Plugin' instead of 'plugin'.", "location": {"path": "docs/plugins/config.rst", "range": {"start": {"line": 707, "column": 56}}}, "severity": "ERROR"}

Check warning on line 707 in docs/plugins/config.rst

View workflow job for this annotation

GitHub Actions / prose

[vale] reported by reviewdog 🐶 [Google.WordList] Use 'capability' or 'feature' instead of 'functionality'. Raw Output: {"message": "[Google.WordList] Use 'capability' or 'feature' instead of 'functionality'.", "location": {"path": "docs/plugins/config.rst", "range": {"start": {"line": 707, "column": 127}}}, "severity": "WARNING"}

Check failure on line 707 in docs/plugins/config.rst

View workflow job for this annotation

GitHub Actions / prose

[vale] reported by reviewdog 🐶 [Vale.Terms] Use 'Plugin' instead of 'plugin'. Raw Output: {"message": "[Vale.Terms] Use 'Plugin' instead of 'plugin'.", "location": {"path": "docs/plugins/config.rst", "range": {"start": {"line": 707, "column": 56}}}, "severity": "ERROR"}

Check warning on line 707 in docs/plugins/config.rst

View workflow job for this annotation

GitHub Actions / prose

[vale] reported by reviewdog 🐶 [Mautic.FeatureList] Is this referring to a Mautic feature? If so, use 'Plugin' instead of 'plugin'. Raw Output: {"message": "[Mautic.FeatureList] Is this referring to a Mautic feature? If so, use 'Plugin' instead of 'plugin'.", "location": {"path": "docs/plugins/config.rst", "range": {"start": {"line": 707, "column": 56}}}, "severity": "INFO"}

Check warning on line 707 in docs/plugins/config.rst

View workflow job for this annotation

GitHub Actions / prose

[vale] reported by reviewdog 🐶 [Google.WordList] Use 'capability' or 'feature' instead of 'functionality'. Raw Output: {"message": "[Google.WordList] Use 'capability' or 'feature' instead of 'functionality'.", "location": {"path": "docs/plugins/config.rst", "range": {"start": {"line": 707, "column": 127}}}, "severity": "WARNING"}

Mautic plugins allow you to define these parameters for use within your plugin’s code. Store these parameters in ``app/config/local.php``, and define their default values in the plugin’s own config file to ensure stability and avoid errors.

Check warning on line 709 in docs/plugins/config.rst

View workflow job for this annotation

GitHub Actions / prose

[vale] reported by reviewdog 🐶 [Mautic.FeatureList] Is this referring to a Mautic feature? If so, use 'Plugins' instead of 'plugins'. Raw Output: {"message": "[Mautic.FeatureList] Is this referring to a Mautic feature? If so, use 'Plugins' instead of 'plugins'.", "location": {"path": "docs/plugins/config.rst", "range": {"start": {"line": 709, "column": 8}}}, "severity": "INFO"}

Check failure on line 709 in docs/plugins/config.rst

View workflow job for this annotation

GitHub Actions / prose

[vale] reported by reviewdog 🐶 [Vale.Terms] Use 'Plugins' instead of 'plugins'. Raw Output: {"message": "[Vale.Terms] Use 'Plugins' instead of 'plugins'.", "location": {"path": "docs/plugins/config.rst", "range": {"start": {"line": 709, "column": 8}}}, "severity": "ERROR"}

Check failure on line 709 in docs/plugins/config.rst

View workflow job for this annotation

GitHub Actions / prose

[vale] reported by reviewdog 🐶 [Vale.Terms] Use 'Plugin' instead of 'plugin'. Raw Output: {"message": "[Vale.Terms] Use 'Plugin' instead of 'plugin'.", "location": {"path": "docs/plugins/config.rst", "range": {"start": {"line": 709, "column": 73}}}, "severity": "ERROR"}

Check warning on line 709 in docs/plugins/config.rst

View workflow job for this annotation

GitHub Actions / prose

[vale] reported by reviewdog 🐶 [Mautic.FeatureList] Is this referring to a Mautic feature? If so, use 'Plugin' instead of 'plugin'. Raw Output: {"message": "[Mautic.FeatureList] Is this referring to a Mautic feature? If so, use 'Plugin' instead of 'plugin'.", "location": {"path": "docs/plugins/config.rst", "range": {"start": {"line": 709, "column": 73}}}, "severity": "INFO"}

Check warning on line 709 in docs/plugins/config.rst

View workflow job for this annotation

GitHub Actions / prose

[vale] reported by reviewdog 🐶 [Mautic.FeatureList] Is this referring to a Mautic feature? If so, use 'Plugin' instead of 'plugin'. Raw Output: {"message": "[Mautic.FeatureList] Is this referring to a Mautic feature? If so, use 'Plugin' instead of 'plugin'.", "location": {"path": "docs/plugins/config.rst", "range": {"start": {"line": 709, "column": 179}}}, "severity": "INFO"}

Check failure on line 709 in docs/plugins/config.rst

View workflow job for this annotation

GitHub Actions / prose

[vale] reported by reviewdog 🐶 [Vale.Terms] Use 'Plugin' instead of 'plugin'. Raw Output: {"message": "[Vale.Terms] Use 'Plugin' instead of 'plugin'.", "location": {"path": "docs/plugins/config.rst", "range": {"start": {"line": 709, "column": 179}}}, "severity": "ERROR"}

Check failure on line 709 in docs/plugins/config.rst

View workflow job for this annotation

GitHub Actions / prose

[vale] reported by reviewdog 🐶 [Vale.Terms] Use 'Plugins' instead of 'plugins'. Raw Output: {"message": "[Vale.Terms] Use 'Plugins' instead of 'plugins'.", "location": {"path": "docs/plugins/config.rst", "range": {"start": {"line": 709, "column": 8}}}, "severity": "ERROR"}

Check warning on line 709 in docs/plugins/config.rst

View workflow job for this annotation

GitHub Actions / prose

[vale] reported by reviewdog 🐶 [Mautic.FeatureList] Is this referring to a Mautic feature? If so, use 'Plugins' instead of 'plugins'. Raw Output: {"message": "[Mautic.FeatureList] Is this referring to a Mautic feature? If so, use 'Plugins' instead of 'plugins'.", "location": {"path": "docs/plugins/config.rst", "range": {"start": {"line": 709, "column": 8}}}, "severity": "INFO"}

Check failure on line 709 in docs/plugins/config.rst

View workflow job for this annotation

GitHub Actions / prose

[vale] reported by reviewdog 🐶 [Vale.Terms] Use 'Plugin' instead of 'plugin'. Raw Output: {"message": "[Vale.Terms] Use 'Plugin' instead of 'plugin'.", "location": {"path": "docs/plugins/config.rst", "range": {"start": {"line": 709, "column": 73}}}, "severity": "ERROR"}

Check warning on line 709 in docs/plugins/config.rst

View workflow job for this annotation

GitHub Actions / prose

[vale] reported by reviewdog 🐶 [Mautic.FeatureList] Is this referring to a Mautic feature? If so, use 'Plugin' instead of 'plugin'. Raw Output: {"message": "[Mautic.FeatureList] Is this referring to a Mautic feature? If so, use 'Plugin' instead of 'plugin'.", "location": {"path": "docs/plugins/config.rst", "range": {"start": {"line": 709, "column": 73}}}, "severity": "INFO"}

Check warning on line 709 in docs/plugins/config.rst

View workflow job for this annotation

GitHub Actions / prose

[vale] reported by reviewdog 🐶 [Mautic.FeatureList] Is this referring to a Mautic feature? If so, use 'Plugin' instead of 'plugin'. Raw Output: {"message": "[Mautic.FeatureList] Is this referring to a Mautic feature? If so, use 'Plugin' instead of 'plugin'.", "location": {"path": "docs/plugins/config.rst", "range": {"start": {"line": 709, "column": 179}}}, "severity": "INFO"}

Check failure on line 709 in docs/plugins/config.rst

View workflow job for this annotation

GitHub Actions / prose

[vale] reported by reviewdog 🐶 [Vale.Terms] Use 'Plugin' instead of 'plugin'. Raw Output: {"message": "[Vale.Terms] Use 'Plugin' instead of 'plugin'.", "location": {"path": "docs/plugins/config.rst", "range": {"start": {"line": 709, "column": 179}}}, "severity": "ERROR"}

Check failure on line 709 in docs/plugins/config.rst

View workflow job for this annotation

GitHub Actions / prose

[vale] reported by reviewdog 🐶 [Vale.Terms] Use 'Plugins' instead of 'plugins'. Raw Output: {"message": "[Vale.Terms] Use 'Plugins' instead of 'plugins'.", "location": {"path": "docs/plugins/config.rst", "range": {"start": {"line": 709, "column": 8}}}, "severity": "ERROR"}

Check warning on line 709 in docs/plugins/config.rst

View workflow job for this annotation

GitHub Actions / prose

[vale] reported by reviewdog 🐶 [Mautic.FeatureList] Is this referring to a Mautic feature? If so, use 'Plugins' instead of 'plugins'. Raw Output: {"message": "[Mautic.FeatureList] Is this referring to a Mautic feature? If so, use 'Plugins' instead of 'plugins'.", "location": {"path": "docs/plugins/config.rst", "range": {"start": {"line": 709, "column": 8}}}, "severity": "INFO"}

Check failure on line 709 in docs/plugins/config.rst

View workflow job for this annotation

GitHub Actions / prose

[vale] reported by reviewdog 🐶 [Vale.Terms] Use 'Plugin' instead of 'plugin'. Raw Output: {"message": "[Vale.Terms] Use 'Plugin' instead of 'plugin'.", "location": {"path": "docs/plugins/config.rst", "range": {"start": {"line": 709, "column": 73}}}, "severity": "ERROR"}

Check warning on line 709 in docs/plugins/config.rst

View workflow job for this annotation

GitHub Actions / prose

[vale] reported by reviewdog 🐶 [Mautic.FeatureList] Is this referring to a Mautic feature? If so, use 'Plugin' instead of 'plugin'. Raw Output: {"message": "[Mautic.FeatureList] Is this referring to a Mautic feature? If so, use 'Plugin' instead of 'plugin'.", "location": {"path": "docs/plugins/config.rst", "range": {"start": {"line": 709, "column": 73}}}, "severity": "INFO"}

Check warning on line 709 in docs/plugins/config.rst

View workflow job for this annotation

GitHub Actions / prose

[vale] reported by reviewdog 🐶 [Mautic.FeatureList] Is this referring to a Mautic feature? If so, use 'Plugin' instead of 'plugin'. Raw Output: {"message": "[Mautic.FeatureList] Is this referring to a Mautic feature? If so, use 'Plugin' instead of 'plugin'.", "location": {"path": "docs/plugins/config.rst", "range": {"start": {"line": 709, "column": 179}}}, "severity": "INFO"}

Check failure on line 709 in docs/plugins/config.rst

View workflow job for this annotation

GitHub Actions / prose

[vale] reported by reviewdog 🐶 [Vale.Terms] Use 'Plugin' instead of 'plugin'. Raw Output: {"message": "[Vale.Terms] Use 'Plugin' instead of 'plugin'.", "location": {"path": "docs/plugins/config.rst", "range": {"start": {"line": 709, "column": 179}}}, "severity": "ERROR"}

Check warning on line 709 in docs/plugins/config.rst

View workflow job for this annotation

GitHub Actions / prose

[vale] reported by reviewdog 🐶 [Mautic.FeatureList] Is this referring to a Mautic feature? If so, use 'Plugins' instead of 'plugins'. Raw Output: {"message": "[Mautic.FeatureList] Is this referring to a Mautic feature? If so, use 'Plugins' instead of 'plugins'.", "location": {"path": "docs/plugins/config.rst", "range": {"start": {"line": 709, "column": 8}}}, "severity": "INFO"}

Check failure on line 709 in docs/plugins/config.rst

View workflow job for this annotation

GitHub Actions / prose

[vale] reported by reviewdog 🐶 [Vale.Terms] Use 'Plugins' instead of 'plugins'. Raw Output: {"message": "[Vale.Terms] Use 'Plugins' instead of 'plugins'.", "location": {"path": "docs/plugins/config.rst", "range": {"start": {"line": 709, "column": 8}}}, "severity": "ERROR"}

Check warning on line 709 in docs/plugins/config.rst

View workflow job for this annotation

GitHub Actions / prose

[vale] reported by reviewdog 🐶 [Mautic.FeatureList] Is this referring to a Mautic feature? If so, use 'Plugin' instead of 'plugin'. Raw Output: {"message": "[Mautic.FeatureList] Is this referring to a Mautic feature? If so, use 'Plugin' instead of 'plugin'.", "location": {"path": "docs/plugins/config.rst", "range": {"start": {"line": 709, "column": 73}}}, "severity": "INFO"}

Check failure on line 709 in docs/plugins/config.rst

View workflow job for this annotation

GitHub Actions / prose

[vale] reported by reviewdog 🐶 [Vale.Terms] Use 'Plugin' instead of 'plugin'. Raw Output: {"message": "[Vale.Terms] Use 'Plugin' instead of 'plugin'.", "location": {"path": "docs/plugins/config.rst", "range": {"start": {"line": 709, "column": 73}}}, "severity": "ERROR"}

Check failure on line 709 in docs/plugins/config.rst

View workflow job for this annotation

GitHub Actions / prose

[vale] reported by reviewdog 🐶 [Vale.Terms] Use 'Plugin' instead of 'plugin'. Raw Output: {"message": "[Vale.Terms] Use 'Plugin' instead of 'plugin'.", "location": {"path": "docs/plugins/config.rst", "range": {"start": {"line": 709, "column": 179}}}, "severity": "ERROR"}

Check warning on line 709 in docs/plugins/config.rst

View workflow job for this annotation

GitHub Actions / prose

[vale] reported by reviewdog 🐶 [Mautic.FeatureList] Is this referring to a Mautic feature? If so, use 'Plugin' instead of 'plugin'. Raw Output: {"message": "[Mautic.FeatureList] Is this referring to a Mautic feature? If so, use 'Plugin' instead of 'plugin'.", "location": {"path": "docs/plugins/config.rst", "range": {"start": {"line": 709, "column": 179}}}, "severity": "INFO"}

To avoid errors during cache compilation or when accessing parameters directly from the container without checking for their existence, always define custom parameters in the `plugin’s config file <https://devdocs.mautic.org/en/latest/plugins/config.html#parameters-config-items>`_. This guarantees that the parameter exists and has a fallback value.

Check failure on line 711 in docs/plugins/config.rst

View workflow job for this annotation

GitHub Actions / prose

[vale] reported by reviewdog 🐶 [Vale.Terms] Use 'Plugin' instead of 'plugin'. Raw Output: {"message": "[Vale.Terms] Use 'Plugin' instead of 'plugin'.", "location": {"path": "docs/plugins/config.rst", "range": {"start": {"line": 711, "column": 177}}}, "severity": "ERROR"}

Check warning on line 711 in docs/plugins/config.rst

View workflow job for this annotation

GitHub Actions / prose

[vale] reported by reviewdog 🐶 [Mautic.FeatureList] Is this referring to a Mautic feature? If so, use 'Plugin' instead of 'plugin'. Raw Output: {"message": "[Mautic.FeatureList] Is this referring to a Mautic feature? If so, use 'Plugin' instead of 'plugin'.", "location": {"path": "docs/plugins/config.rst", "range": {"start": {"line": 711, "column": 177}}}, "severity": "INFO"}

Check warning on line 711 in docs/plugins/config.rst

View workflow job for this annotation

GitHub Actions / prose

[vale] reported by reviewdog 🐶 [Mautic.FeatureList] Is this referring to a Mautic feature? If so, use 'Plugin' instead of 'plugin'. Raw Output: {"message": "[Mautic.FeatureList] Is this referring to a Mautic feature? If so, use 'Plugin' instead of 'plugin'.", "location": {"path": "docs/plugins/config.rst", "range": {"start": {"line": 711, "column": 177}}}, "severity": "INFO"}

Check failure on line 711 in docs/plugins/config.rst

View workflow job for this annotation

GitHub Actions / prose

[vale] reported by reviewdog 🐶 [Vale.Terms] Use 'Plugin' instead of 'plugin'. Raw Output: {"message": "[Vale.Terms] Use 'Plugin' instead of 'plugin'.", "location": {"path": "docs/plugins/config.rst", "range": {"start": {"line": 711, "column": 177}}}, "severity": "ERROR"}

Check warning on line 711 in docs/plugins/config.rst

View workflow job for this annotation

GitHub Actions / prose

[vale] reported by reviewdog 🐶 [Mautic.FeatureList] Is this referring to a Mautic feature? If so, use 'Plugin' instead of 'plugin'. Raw Output: {"message": "[Mautic.FeatureList] Is this referring to a Mautic feature? If so, use 'Plugin' instead of 'plugin'.", "location": {"path": "docs/plugins/config.rst", "range": {"start": {"line": 711, "column": 177}}}, "severity": "INFO"}

Check failure on line 711 in docs/plugins/config.rst

View workflow job for this annotation

GitHub Actions / prose

[vale] reported by reviewdog 🐶 [Vale.Terms] Use 'Plugin' instead of 'plugin'. Raw Output: {"message": "[Vale.Terms] Use 'Plugin' instead of 'plugin'.", "location": {"path": "docs/plugins/config.rst", "range": {"start": {"line": 711, "column": 177}}}, "severity": "ERROR"}

Check failure on line 711 in docs/plugins/config.rst

View workflow job for this annotation

GitHub Actions / prose

[vale] reported by reviewdog 🐶 [Vale.Terms] Use 'Plugin' instead of 'plugin'. Raw Output: {"message": "[Vale.Terms] Use 'Plugin' instead of 'plugin'.", "location": {"path": "docs/plugins/config.rst", "range": {"start": {"line": 711, "column": 177}}}, "severity": "ERROR"}

Check warning on line 711 in docs/plugins/config.rst

View workflow job for this annotation

GitHub Actions / prose

[vale] reported by reviewdog 🐶 [Mautic.FeatureList] Is this referring to a Mautic feature? If so, use 'Plugin' instead of 'plugin'. Raw Output: {"message": "[Mautic.FeatureList] Is this referring to a Mautic feature? If so, use 'Plugin' instead of 'plugin'.", "location": {"path": "docs/plugins/config.rst", "range": {"start": {"line": 711, "column": 177}}}, "severity": "INFO"}

To add these configuration options in the configuration page, you’ll need:

Check warning on line 713 in docs/plugins/config.rst

View workflow job for this annotation

GitHub Actions / prose

[vale] reported by reviewdog 🐶 [Mautic.FeatureList] Is this referring to a Mautic feature? If so, use 'Landing Page' instead of 'page'. Raw Output: {"message": "[Mautic.FeatureList] Is this referring to a Mautic feature? If so, use 'Landing Page' instead of 'page'.", "location": {"path": "docs/plugins/config.rst", "range": {"start": {"line": 713, "column": 57}}}, "severity": "INFO"}

Check warning on line 713 in docs/plugins/config.rst

View workflow job for this annotation

GitHub Actions / prose

[vale] reported by reviewdog 🐶 [Mautic.FeatureList] Is this referring to a Mautic feature? If so, use 'Landing Page' instead of 'page'. Raw Output: {"message": "[Mautic.FeatureList] Is this referring to a Mautic feature? If so, use 'Landing Page' instead of 'page'.", "location": {"path": "docs/plugins/config.rst", "range": {"start": {"line": 713, "column": 57}}}, "severity": "INFO"}

Check warning on line 713 in docs/plugins/config.rst

View workflow job for this annotation

GitHub Actions / prose

[vale] reported by reviewdog 🐶 [Mautic.FeatureList] Is this referring to a Mautic feature? If so, use 'Landing Page' instead of 'page'. Raw Output: {"message": "[Mautic.FeatureList] Is this referring to a Mautic feature? If so, use 'Landing Page' instead of 'page'.", "location": {"path": "docs/plugins/config.rst", "range": {"start": {"line": 713, "column": 57}}}, "severity": "INFO"}

Check warning on line 713 in docs/plugins/config.rst

View workflow job for this annotation

GitHub Actions / prose

[vale] reported by reviewdog 🐶 [Mautic.FeatureList] Is this referring to a Mautic feature? If so, use 'Landing Page' instead of 'page'. Raw Output: {"message": "[Mautic.FeatureList] Is this referring to a Mautic feature? If so, use 'Landing Page' instead of 'page'.", "location": {"path": "docs/plugins/config.rst", "range": {"start": {"line": 713, "column": 57}}}, "severity": "INFO"}

- An `event subscriber <https://devdocs.mautic.org/en/latest/plugins/event_listeners.html>`_ to register the configuration.
- A `form type <https://devdocs.mautic.org/en/latest/components/forms.html>`_ that defines the fields.

Check warning on line 716 in docs/plugins/config.rst

View workflow job for this annotation

GitHub Actions / prose

[vale] reported by reviewdog 🐶 [Mautic.FeatureList] Is this referring to a Mautic feature? If so, use 'Form' instead of 'form'. Raw Output: {"message": "[Mautic.FeatureList] Is this referring to a Mautic feature? If so, use 'Form' instead of 'form'.", "location": {"path": "docs/plugins/config.rst", "range": {"start": {"line": 716, "column": 6}}}, "severity": "INFO"}

Check warning on line 716 in docs/plugins/config.rst

View workflow job for this annotation

GitHub Actions / prose

[vale] reported by reviewdog 🐶 [Mautic.FeatureList] Is this referring to a Mautic feature? If so, use 'Form' instead of 'form'. Raw Output: {"message": "[Mautic.FeatureList] Is this referring to a Mautic feature? If so, use 'Form' instead of 'form'.", "location": {"path": "docs/plugins/config.rst", "range": {"start": {"line": 716, "column": 6}}}, "severity": "INFO"}

Check warning on line 716 in docs/plugins/config.rst

View workflow job for this annotation

GitHub Actions / prose

[vale] reported by reviewdog 🐶 [Mautic.FeatureList] Is this referring to a Mautic feature? If so, use 'Form' instead of 'form'. Raw Output: {"message": "[Mautic.FeatureList] Is this referring to a Mautic feature? If so, use 'Form' instead of 'form'.", "location": {"path": "docs/plugins/config.rst", "range": {"start": {"line": 716, "column": 6}}}, "severity": "INFO"}

Check warning on line 716 in docs/plugins/config.rst

View workflow job for this annotation

GitHub Actions / prose

[vale] reported by reviewdog 🐶 [Mautic.FeatureList] Is this referring to a Mautic feature? If so, use 'Form' instead of 'form'. Raw Output: {"message": "[Mautic.FeatureList] Is this referring to a Mautic feature? If so, use 'Form' instead of 'form'.", "location": {"path": "docs/plugins/config.rst", "range": {"start": {"line": 716, "column": 6}}}, "severity": "INFO"}
- A specific view for rendering the form.

Check warning on line 717 in docs/plugins/config.rst

View workflow job for this annotation

GitHub Actions / prose

[vale] reported by reviewdog 🐶 [Mautic.FeatureList] Is this referring to a Mautic feature? If so, use 'Form' instead of 'form'. Raw Output: {"message": "[Mautic.FeatureList] Is this referring to a Mautic feature? If so, use 'Form' instead of 'form'.", "location": {"path": "docs/plugins/config.rst", "range": {"start": {"line": 717, "column": 37}}}, "severity": "INFO"}

Check warning on line 717 in docs/plugins/config.rst

View workflow job for this annotation

GitHub Actions / prose

[vale] reported by reviewdog 🐶 [Mautic.FeatureList] Is this referring to a Mautic feature? If so, use 'Form' instead of 'form'. Raw Output: {"message": "[Mautic.FeatureList] Is this referring to a Mautic feature? If so, use 'Form' instead of 'form'.", "location": {"path": "docs/plugins/config.rst", "range": {"start": {"line": 717, "column": 37}}}, "severity": "INFO"}

Check warning on line 717 in docs/plugins/config.rst

View workflow job for this annotation

GitHub Actions / prose

[vale] reported by reviewdog 🐶 [Mautic.FeatureList] Is this referring to a Mautic feature? If so, use 'Form' instead of 'form'. Raw Output: {"message": "[Mautic.FeatureList] Is this referring to a Mautic feature? If so, use 'Form' instead of 'form'.", "location": {"path": "docs/plugins/config.rst", "range": {"start": {"line": 717, "column": 37}}}, "severity": "INFO"}

Check warning on line 717 in docs/plugins/config.rst

View workflow job for this annotation

GitHub Actions / prose

[vale] reported by reviewdog 🐶 [Mautic.FeatureList] Is this referring to a Mautic feature? If so, use 'Form' instead of 'form'. Raw Output: {"message": "[Mautic.FeatureList] Is this referring to a Mautic feature? If so, use 'Form' instead of 'form'.", "location": {"path": "docs/plugins/config.rst", "range": {"start": {"line": 717, "column": 37}}}, "severity": "INFO"}

.. note::

To translate the plugin’s tab label in the configuration form, include a translation key like ``mautic.config.tab.helloworld_config`` in the plugin’s ``messages.ini`` file. Replace ``helloworld_config`` with the ``formAlias`` used when registering the form in the event subscriber.

Check failure on line 721 in docs/plugins/config.rst

View workflow job for this annotation

GitHub Actions / prose

[vale] reported by reviewdog 🐶 [Vale.Terms] Use 'Plugin' instead of 'plugin'. Raw Output: {"message": "[Vale.Terms] Use 'Plugin' instead of 'plugin'.", "location": {"path": "docs/plugins/config.rst", "range": {"start": {"line": 721, "column": 21}}}, "severity": "ERROR"}

Check failure on line 721 in docs/plugins/config.rst

View workflow job for this annotation

GitHub Actions / prose

[vale] reported by reviewdog 🐶 [Vale.Terms] Use 'Plugin' instead of 'plugin'. Raw Output: {"message": "[Vale.Terms] Use 'Plugin' instead of 'plugin'.", "location": {"path": "docs/plugins/config.rst", "range": {"start": {"line": 721, "column": 145}}}, "severity": "ERROR"}

Check failure on line 721 in docs/plugins/config.rst

View workflow job for this annotation

GitHub Actions / prose

[vale] reported by reviewdog 🐶 [Vale.Terms] Use 'Plugin' instead of 'plugin'. Raw Output: {"message": "[Vale.Terms] Use 'Plugin' instead of 'plugin'.", "location": {"path": "docs/plugins/config.rst", "range": {"start": {"line": 721, "column": 21}}}, "severity": "ERROR"}

Check failure on line 721 in docs/plugins/config.rst

View workflow job for this annotation

GitHub Actions / prose

[vale] reported by reviewdog 🐶 [Vale.Terms] Use 'Plugin' instead of 'plugin'. Raw Output: {"message": "[Vale.Terms] Use 'Plugin' instead of 'plugin'.", "location": {"path": "docs/plugins/config.rst", "range": {"start": {"line": 721, "column": 145}}}, "severity": "ERROR"}

Check failure on line 721 in docs/plugins/config.rst

View workflow job for this annotation

GitHub Actions / prose

[vale] reported by reviewdog 🐶 [Vale.Terms] Use 'Plugin' instead of 'plugin'. Raw Output: {"message": "[Vale.Terms] Use 'Plugin' instead of 'plugin'.", "location": {"path": "docs/plugins/config.rst", "range": {"start": {"line": 721, "column": 21}}}, "severity": "ERROR"}

Check failure on line 721 in docs/plugins/config.rst

View workflow job for this annotation

GitHub Actions / prose

[vale] reported by reviewdog 🐶 [Vale.Terms] Use 'Plugin' instead of 'plugin'. Raw Output: {"message": "[Vale.Terms] Use 'Plugin' instead of 'plugin'.", "location": {"path": "docs/plugins/config.rst", "range": {"start": {"line": 721, "column": 145}}}, "severity": "ERROR"}

Check failure on line 721 in docs/plugins/config.rst

View workflow job for this annotation

GitHub Actions / prose

[vale] reported by reviewdog 🐶 [Vale.Terms] Use 'Plugin' instead of 'plugin'. Raw Output: {"message": "[Vale.Terms] Use 'Plugin' instead of 'plugin'.", "location": {"path": "docs/plugins/config.rst", "range": {"start": {"line": 721, "column": 21}}}, "severity": "ERROR"}

Check failure on line 721 in docs/plugins/config.rst

View workflow job for this annotation

GitHub Actions / prose

[vale] reported by reviewdog 🐶 [Vale.Terms] Use 'Plugin' instead of 'plugin'. Raw Output: {"message": "[Vale.Terms] Use 'Plugin' instead of 'plugin'.", "location": {"path": "docs/plugins/config.rst", "range": {"start": {"line": 721, "column": 145}}}, "severity": "ERROR"}


Config event subscriber

Check failure on line 724 in docs/plugins/config.rst

View workflow job for this annotation

GitHub Actions / prose

[vale] reported by reviewdog 🐶 [Vale.Terms] Use 'config' instead of 'Config'. Raw Output: {"message": "[Vale.Terms] Use 'config' instead of 'Config'.", "location": {"path": "docs/plugins/config.rst", "range": {"start": {"line": 724, "column": 1}}}, "severity": "ERROR"}

Check failure on line 724 in docs/plugins/config.rst

View workflow job for this annotation

GitHub Actions / prose

[vale] reported by reviewdog 🐶 [Vale.Terms] Use 'config' instead of 'Config'. Raw Output: {"message": "[Vale.Terms] Use 'config' instead of 'Config'.", "location": {"path": "docs/plugins/config.rst", "range": {"start": {"line": 724, "column": 1}}}, "severity": "ERROR"}

Check failure on line 724 in docs/plugins/config.rst

View workflow job for this annotation

GitHub Actions / prose

[vale] reported by reviewdog 🐶 [Vale.Terms] Use 'config' instead of 'Config'. Raw Output: {"message": "[Vale.Terms] Use 'config' instead of 'Config'.", "location": {"path": "docs/plugins/config.rst", "range": {"start": {"line": 724, "column": 1}}}, "severity": "ERROR"}

Check failure on line 724 in docs/plugins/config.rst

View workflow job for this annotation

GitHub Actions / prose

[vale] reported by reviewdog 🐶 [Vale.Terms] Use 'config' instead of 'Config'. Raw Output: {"message": "[Vale.Terms] Use 'config' instead of 'Config'.", "location": {"path": "docs/plugins/config.rst", "range": {"start": {"line": 724, "column": 1}}}, "severity": "ERROR"}
=======================

This allows plugins to interact with Mautic's configuration events. It listens to two important events: ``ConfigEvents::CONFIG_ON_GENERATE`` and ``ConfigEvents::CONFIG_PRE_SAVE``.

Check failure on line 727 in docs/plugins/config.rst

View workflow job for this annotation

GitHub Actions / prose

[vale] reported by reviewdog 🐶 [Vale.Terms] Use 'Plugins' instead of 'plugins'. Raw Output: {"message": "[Vale.Terms] Use 'Plugins' instead of 'plugins'.", "location": {"path": "docs/plugins/config.rst", "range": {"start": {"line": 727, "column": 13}}}, "severity": "ERROR"}

Check failure on line 727 in docs/plugins/config.rst

View workflow job for this annotation

GitHub Actions / prose

[vale] reported by reviewdog 🐶 [Vale.Terms] Use 'Plugins' instead of 'plugins'. Raw Output: {"message": "[Vale.Terms] Use 'Plugins' instead of 'plugins'.", "location": {"path": "docs/plugins/config.rst", "range": {"start": {"line": 727, "column": 13}}}, "severity": "ERROR"}

Check failure on line 727 in docs/plugins/config.rst

View workflow job for this annotation

GitHub Actions / prose

[vale] reported by reviewdog 🐶 [Vale.Terms] Use 'Plugins' instead of 'plugins'. Raw Output: {"message": "[Vale.Terms] Use 'Plugins' instead of 'plugins'.", "location": {"path": "docs/plugins/config.rst", "range": {"start": {"line": 727, "column": 13}}}, "severity": "ERROR"}

Check failure on line 727 in docs/plugins/config.rst

View workflow job for this annotation

GitHub Actions / prose

[vale] reported by reviewdog 🐶 [Vale.Terms] Use 'Plugins' instead of 'plugins'. Raw Output: {"message": "[Vale.Terms] Use 'Plugins' instead of 'plugins'.", "location": {"path": "docs/plugins/config.rst", "range": {"start": {"line": 727, "column": 13}}}, "severity": "ERROR"}

The following code example demonstrates how the event subscriber is structured in a plugin.

.. code-block:: php

<?php
// plugins/HelloWorldBundle/EventListener/ConfigSubscriber.php

namespace MauticPlugin\HelloWorldBundle\EventListener;

use Mautic\ConfigBundle\Event\ConfigEvent;
use Mautic\CoreBundle\EventListener\CommonSubscriber;
use Mautic\ConfigBundle\ConfigEvents;
use Mautic\ConfigBundle\Event\ConfigBuilderEvent;

/**
* Class ConfigSubscriber
*/
class ConfigSubscriber extends CommonSubscriber
{
/**
* @return array
*/
static public function getSubscribedEvents()
{
return [
ConfigEvents::CONFIG_ON_GENERATE => ['onConfigGenerate', 0],
ConfigEvents::CONFIG_PRE_SAVE => ['onConfigSave', 0]
];
}

/**
* @param ConfigBuilderEvent $event
*/
public function onConfigGenerate(ConfigBuilderEvent $event)
{
$event->addForm(
[
'formAlias' => 'helloworld_config',
'formTheme' => 'HelloWorldBundle:FormTheme\Config',
'parameters' => $event->getParametersFromConfig('HelloWorldBundle')
]
);
}

/**
* @param ConfigEvent $event
*/
public function onConfigSave(ConfigEvent $event)
{
/** @var array $values */
$values = $event->getConfig();

// Manipulate the values
if (!empty($values['helloworld_config']['custom_config_option'])) {
$values['helloworld_config']['custom_config_option'] = htmlspecialchars($values['helloworld_config']['custom_config_option']);
}

// Set updated values
$event->setConfig($values);
}
}


Subscribed events
-----------------

The event subscriber listens to the following events:

- ``ConfigEvents::CONFIG_ON_GENERATE``:
This event is dispatched when the configuration form is built. This allows the plugin to inject its own tab and configuration options.

- ``ConfigEvents::CONFIG_PRE_SAVE``:
This event is triggered before the form values are rendered and saved to the ``local.php`` file. This allows the plugin to clean up or modify the data before writing it to ``local.php``.

Generate plugin configuration
---------------------------------

To register plugin’s configuration details during the ``ConfigEvents::CONFIG_ON_GENERATE event``, call the ``addForm()`` method on the ``ConfigBuilderEvent`` object. The method expects an array with the following elements:

.. list-table::
:header-rows: 1

* - Key
- Description
* - ``formAlias``
- The alias of the form type class that defines the expected form elements.
* - ``formTheme``
- The view that formats the configuration form elements, e.g., ``HelloWorldBundle:FormTheme\Config``.
* - ``parameters``
- An array of custom configuration elements. ``Use $event->getParametersFromConfig('HelloWorldBundle')`` to retrieve them from the plugin’s configuration file.

Modify configuration before saving
--------------------------------------

To modify the form data before saving, use the ``ConfigEvents::CONFIG_PRE_SAVE event``. This event is triggered just before values are saved to the ``local.php`` file, allowing the plugin to adjust them.

Register the event subscriber
--------------------------

Register the subscriber through the plugin’s configuration in the ``services[events]`` `section <https://devdocs.mautic.org/en/latest/plugins/config.html#service-config-items>`_. This ensures that the plugin listens for the events and reacts accordingly.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Register the subscriber through the plugin’s configuration in the ``services[events]`` `section <https://devdocs.mautic.org/en/latest/plugins/config.html#service-config-items>`_. This ensures that the plugin listens for the events and reacts accordingly.
Register the subscriber through the Plugin’s configuration in the ``services[events]`` `section <https://devdocs.mautic.org/en/latest/plugins/config.html#service-config-items>`_. This ensures that the plugin listens for the events and reacts accordingly.

Please also fix the link. Use the sphinx link reference, we don't link like this.

Copy link
Author

@Teebarh Teebarh Apr 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How does this look?

services[events] in :ref:plugins/config:Service config items

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When you build the docs with make html and check it when it renders, does the link work? That's what you should be doing to verify these things.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it does😊.



Config form
=============

The form type is used to generate the form fields in the main configuration form. See the `Forms documentation <https://devdocs.mautic.org/en/latest/components/forms.html>`_ for more information about using form types.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The form type is used to generate the form fields in the main configuration form. See the `Forms documentation <https://devdocs.mautic.org/en/latest/components/forms.html>`_ for more information about using form types.
The form type is used to generate the fields in the main configuration form. See the `Forms documentation <https://devdocs.mautic.org/en/latest/components/forms.html>`_ for more information about using form types.

Please also fix the link. See earlier comments.


Remember that the form type must be registered through the plugin’s config in the ``services[forms]`` `section <https://devdocs.mautic.org/en/latest/plugins/config.html#service-config-items>`_
.

Below is an example of a form type class that adds a custom configuration option to the plugin's configuration form.

.. code-block:: php

<?php
// plugins/HelloWorldBundle/Form/Type/ConfigType.php

namespace MauticPlugin\HelloWorldBundle\Form\Type;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;

/**
* Class ConfigType
*/
class ConfigType extends AbstractType
{
/**
* @param FormBuilderInterface $builder
* @param array $options
*/
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder->add(
'custom_config_option',
'text',
array(
'label' => 'plugin.helloworld.config.custom_config_option',
'data' => $options['data']['custom_config_option'],
'attr' => array(
'tooltip' => 'plugin.helloworld.config.custom_config_option_tooltip'
)
)
);
}

/**
* {@inheritdoc}
*/
public function getName()
{
return 'helloworld_config';
}
}

Config template
=============

Registering a form theme as ``HelloWorldBundle:FormTheme\Config`` in the event listener tells the ConfigBundle to look in the HelloWorldBundle’s ``Views/FormTheme/Config`` folder for templates. Specifically, it will look for a template named ``_config_{formAlias}_widget.html.php``, where ``{formAlias}`` is the same as the ``formAlias`` set in the plugin’s ``ConfigEvents::CONFIG_ON_GENERATE`` event listener.

The template should be structured in a panel format to match the rest of the configuration UI.

Below is an example of how the template should be structured:

.. code-block:: php

<?php
// plugins/HelloWorldBundle/Views/FormTheme/Config/_config_helloworld_config_widget.html.php

?>

<div class="panel panel-primary">
<div class="panel-heading">
<h3 class="panel-title"><?php echo $view['translator']->trans('mautic.config.tab.helloworld_config'); ?></h3>
</div>
<div class="panel-body">
<?php foreach ($form->children as $f): ?>
<div class="row">
<div class="col-md-6">
<?php echo $view['form']->row($f); ?>
</div>
</div>
<?php endforeach; ?>
</div>
</div>
Loading