Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
ae60d10
Fri 2 May initial draft
dcjarvis May 2, 2025
3f908d9
Add .DS_Store to gitignore
dcjarvis May 22, 2025
c6d5bd7
Updated campaign import/export documentation
dcjarvis May 7, 2025
e57b5e2
updates to user docs for campaign export and import
dcjarvis May 9, 2025
fbef5c6
clarify messenger:consume params
O-Mutt Apr 30, 2025
b64cf46
Update cron_jobs.rst
O-Mutt Apr 30, 2025
bfa6d50
Update cron_jobs.rst
O-Mutt Apr 30, 2025
c274d66
Update cron_jobs.rst
O-Mutt Apr 30, 2025
a044ec1
Update cron_jobs.rst
O-Mutt Apr 30, 2025
bdb0fb9
Update docs/configuration/cron_jobs.rst
O-Mutt Apr 30, 2025
7ddbe75
Update docs/configuration/cron_jobs.rst
O-Mutt May 5, 2025
54669dd
updates from prose review
dcjarvis May 20, 2025
b50e7c9
updates from prose review
dcjarvis May 20, 2025
57b6f71
updates from prose review 2
dcjarvis May 20, 2025
1ff47f6
Resolve .gitignore merge conflict
dcjarvis May 22, 2025
0ad90a0
prose review 3
dcjarvis May 20, 2025
1fc3e86
prose review 4
dcjarvis May 20, 2025
ef57099
prose review 5
dcjarvis May 20, 2025
2b81a5f
prose review 6
dcjarvis May 20, 2025
a911777
prose review complete
dcjarvis May 20, 2025
4f4b529
addition of path to export file command line parameter
dcjarvis May 22, 2025
282ad9b
Merge branch '7.0' into campaign-import-export-user-docs
adiati98 Jul 13, 2025
0ee96ce
Merge branch '7.0' into campaign-import-export-user-docs
RCheesley Nov 4, 2025
e29ebd9
Vale fixes
RCheesley Nov 4, 2025
e05328d
RST syntax fixes
RCheesley Nov 4, 2025
ac6fd7b
Fix grammar
RCheesley Nov 4, 2025
f910271
Remove image height restriction
RCheesley Nov 4, 2025
89478c0
Fix spacing in list
RCheesley Nov 4, 2025
51362b5
use example.com in examples.
RCheesley Nov 4, 2025
e19fd30
Update gitignore
RCheesley Nov 4, 2025
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
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -158,4 +158,4 @@ dmypy.json
# Cython debug symbols
cython_debug/

# End of https://www.toptal.com/developers/gitignore/api/python,jupyternotebooks
# End of https://www.toptal.com/developers/gitignore/api/python,jupyternotebooks
123 changes: 123 additions & 0 deletions docs/campaigns/exporting_campaigns.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
.. vale off

Exporting Campaigns

Check warning on line 3 in docs/campaigns/exporting_campaigns.rst

View workflow job for this annotation

GitHub Actions / prose

[vale] reported by reviewdog 🐶 [Google.Headings] 'Exporting Campaigns' should use sentence-style capitalization. Raw Output: {"message": "[Google.Headings] 'Exporting Campaigns' should use sentence-style capitalization.", "location": {"path": "docs/campaigns/exporting_campaigns.rst", "range": {"start": {"line": 3, "column": 1}}}, "severity": "WARNING"}
###################

.. vale on

Before importing or exporting data, as a safety precaution take a backup of your database so that you can restore data if required. Speak to the administrator of your domain to be able to do this as it requires specific technical knowledge.

.. important::
Both the import and the export features are only available in Mautic 7.0 and later versions.

Supported data types
--------------------

When you select a Campaign, the export feature extracts all Campaign data and entities and any dependencies the Campaign needs to function. This includes:

- Dynamic Content
- Assets
- Custom Fields
- Other related dependencies

The export command:

- Detect use of Plugins and Custom Fields
- Include the data to support these dependencies

.. important::
The importing instance needs the same Custom Fields and Plugins to be present.

.. vale off

How exporting Campaigns works
*****************************

.. vale on

Whether exporting via the UI, the command line or using the API, the Export feature
follows the same process.

- Checks that the User has adequate permissions to export
- Supports exporting multiple Campaigns simultaneously
- Exports data in a structured JSON format
- Exports Assets into a separate folder in their original format
- Zips the resulting collection of files for easy transfer across systems

Export methods
**************

You can use the Export feature in three ways:

UI-based export
---------------

Manual export through Mautic Campaigns dashboard:

# Go to the Campaigns menu
# Select the Campaign you want to Export
# Select the Export option from the dropdown menu located next to the item selection

CLI-based export

Check warning on line 61 in docs/campaigns/exporting_campaigns.rst

View workflow job for this annotation

GitHub Actions / prose

[vale] reported by reviewdog 🐶 [Google.WordList] Use 'command-line tool' instead of 'CLI'. Raw Output: {"message": "[Google.WordList] Use 'command-line tool' instead of 'CLI'.", "location": {"path": "docs/campaigns/exporting_campaigns.rst", "range": {"start": {"line": 61, "column": 1}}}, "severity": "WARNING"}
----------------

Use the following commands:

.. code-block:: bash

bin/console mautic:entity:export --entity=campaign --id=1 --zip-file --path=path/to-file

* `entity` defines the type of entity to Export, in this case `campaign`

Check warning on line 70 in docs/campaigns/exporting_campaigns.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 'Campaign' instead of 'campaign'. Raw Output: {"message": "[Mautic.FeatureList] Is this referring to a Mautic feature? If so, use 'Campaign' instead of 'campaign'.", "location": {"path": "docs/campaigns/exporting_campaigns.rst", "range": {"start": {"line": 70, "column": 64}}}, "severity": "INFO"}
* `id` defines the id of the Campaign to Export. Look at the URL to find the ID when you view or edit the Campaign - the ID appears in the URL for example, ``/s/campaigns/view/123`` where 123 is the ID
* `zip-file` creates a zip file of the Campaign and its dependencies
* `path` specifies the directory to save the exported file.

.. code-block:: bash

bin/console mautic:entity:export --entity=campaign --id=1 --json-file

* Creates only a JSON file and ignores any additional resources

API-based export
----------------

You can export Campaigns programmatically using the Mautic API. You need to authenticate for the API request. using the API credentials stored in Mautic's settings. For more detail on how to authenticate, see the :doc:`Mautic API documentation authentication/authentication.html`.

Check failure on line 84 in docs/campaigns/exporting_campaigns.rst

View workflow job for this annotation

GitHub Actions / prose

[vale] reported by reviewdog 🐶 [Vale.Terms] Use 'HTML' instead of 'html'. Raw Output: {"message": "[Vale.Terms] Use 'HTML' instead of 'html'.", "location": {"path": "docs/campaigns/exporting_campaigns.rst", "range": {"start": {"line": 84, "column": 275}}}, "severity": "ERROR"}

Curl example
************

.. code-block:: bash

curl --location 'https://{your-mautic-domain}/api/campaigns/export/1' \
--header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
--data ''

Python example
**************

.. code-block:: python

import requests

# API Endpoint
campaign_id = 1
url = f'https://example.com/api/campaigns/export/{campaign_id}'

# Authentication
headers = {
'Authorization': 'Bearer YOUR_ACCESS_TOKEN'
}

# Send export request
response = requests.get(url, headers=headers)

# Handle response
if response.status_code == 200:
export_file = response.content
# Save or process the exported campaign

.. important::
- Replace `example.com` with your actual Mautic instance domain
- Replace `YOUR_ACCESS_TOKEN` with a valid authentication token
- The API uses a GET request to export a specific Campaign by ID
- Ensure you have the necessary API permissions
Binary file added docs/campaigns/images/activate-campaign.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading