-
Notifications
You must be signed in to change notification settings - Fork 75
Campaign import export user docs #361
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
dcjarvis
wants to merge
59
commits into
mautic:7.0
Choose a base branch
from
dcjarvis:campaign-import-export-user-docs
base: 7.0
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 57 commits
Commits
Show all changes
59 commits
Select commit
Hold shift + click to select a range
ae60d10
Fri 2 May initial draft
dcjarvis 3f908d9
Add .DS_Store to gitignore
dcjarvis c6d5bd7
Updated campaign import/export documentation
dcjarvis e57b5e2
updates to user docs for campaign export and import
dcjarvis fbef5c6
clarify messenger:consume params
O-Mutt b64cf46
Update cron_jobs.rst
O-Mutt bfa6d50
Update cron_jobs.rst
O-Mutt c274d66
Update cron_jobs.rst
O-Mutt a044ec1
Update cron_jobs.rst
O-Mutt bdb0fb9
Update docs/configuration/cron_jobs.rst
O-Mutt 7ddbe75
Update docs/configuration/cron_jobs.rst
O-Mutt 54669dd
updates from prose review
dcjarvis b50e7c9
updates from prose review
dcjarvis 57b6f71
updates from prose review 2
dcjarvis 1ff47f6
Resolve .gitignore merge conflict
dcjarvis 0ad90a0
prose review 3
dcjarvis 1fc3e86
prose review 4
dcjarvis ef57099
prose review 5
dcjarvis 2b81a5f
prose review 6
dcjarvis a911777
prose review complete
dcjarvis 4f4b529
addition of path to export file command line parameter
dcjarvis 282ad9b
Merge branch '7.0' into campaign-import-export-user-docs
adiati98 0ee96ce
Merge branch '7.0' into campaign-import-export-user-docs
RCheesley e29ebd9
Vale fixes
RCheesley e05328d
RST syntax fixes
RCheesley ac6fd7b
Fix grammar
RCheesley f910271
Remove image height restriction
RCheesley 89478c0
Fix spacing in list
RCheesley 51362b5
use example.com in examples.
RCheesley e19fd30
Update gitignore
RCheesley a721bde
Merge branch '7.0' into campaign-import-export-user-docs
adiati98 552f94f
Merge branch '7.0' into campaign-import-export-user-docs
adiati98 24223d1
Merge branch '7.0' into campaign-import-export-user-docs
adiati98 c7fc039
fix: unrendered table
adiati98 6b1464b
adjust wordings and address Vale in exporting_campaigns.rst and comma…
adiati98 4b99b28
adjust wordings and address vale warnings in importing_campaigns.rst
adiati98 c015187
adjust wording and structure in exporting_campaigns.rst for consistency
adiati98 ea8e73a
apply vale off and on statements
adiati98 a85a892
update instructions to export with mautic instance
adiati98 c2b1c2d
remove campaigns/images/activate-campaign.png
adiati98 51a7845
add images
adiati98 dbebd0e
fix: broken internal links
adiati98 3316507
fix typo
adiati98 80c8590
Merge branch '7.0' into campaign-import-export-user-docs
adiati98 58f0c25
remove campaigns/images/campaign-sample.json
adiati98 054bbc7
remove custom fields from supported data types
adiati98 d1a7364
move how the exporting campaigns works section to the bottom
adiati98 5900ca5
move How the importing Campaign works section to the bottom
adiati98 ab58d10
Merge branch '7.0' into campaign-import-export-user-docs
RCheesley 0cd6665
Merge branch '7.0' into campaign-import-export-user-docs
adiati98 b8da6ff
Apply suggestions from code review
adiati98 b61e638
Apply suggestions from code review
adiati98 81337c4
Apply suggestions from code review
adiati98 3b3e1b1
Apply suggestions from code review
adiati98 5eed0f8
fix: command examples
adiati98 4b25e2f
Merge branch '7.0' into campaign-import-export-user-docs
adiati98 59d34ed
fix: broken python example
adiati98 0a98f2f
fix: apply the same comment as in the suggestion
adiati98 f3acd43
Merge branch '7.0' into campaign-import-export-user-docs
adiati98 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,155 @@ | ||
| Exporting Campaigns | ||
|
Check warning on line 1 in docs/campaigns/exporting_campaigns.rst
|
||
| ################### | ||
|
|
||
| Before importing or exporting data, back up your database as a safety precaution in case you need to restore it. Speak to the administrator of your Mautic instance to do this, as it requires specific technical knowledge. | ||
|
|
||
| .. important:: | ||
|
|
||
| Both the import and export features are available only in Mautic 7.0 and later versions. | ||
|
|
||
| Supported data types | ||
| ******************** | ||
|
|
||
| When you select a Campaign, the export feature extracts all Campaign data and entities, along with any dependencies the Campaign needs to function, including: | ||
|
|
||
| * Dynamic Content | ||
| * Asset\* | ||
| * Other related dependencies | ||
|
|
||
|
adiati98 marked this conversation as resolved.
|
||
| .. note:: | ||
|
|
||
| \* The exported Campaign includes only directly associated Assets. | ||
|
|
||
| The export command: | ||
|
|
||
| * Detect use of Plugins and Custom Fields | ||
| * Include the data to support these dependencies | ||
|
adiati98 marked this conversation as resolved.
|
||
|
|
||
| .. important:: | ||
|
|
||
| The importing instance needs the same Custom Fields and Plugins to be present. | ||
|
adiati98 marked this conversation as resolved.
|
||
|
|
||
| .. vale off | ||
|
|
||
| Exporting a Campaign | ||
| ******************** | ||
|
|
||
| .. vale on | ||
|
|
||
| You can export a Campaign in three ways. | ||
|
|
||
| 1.\ Using Mautic instance | ||
| ========================= | ||
|
|
||
| #. Go to the **Campaigns** menu. | ||
| #. Click the three-dot icon next to the Campaign's name that you want to export to open the options. | ||
| #. Select the **Export** option from the dropdown menu. It automatically downloads the ZIP file. | ||
|
|
||
| | | ||
|
|
||
| .. image:: images/export_campaign.png | ||
| :alt: Highlight of Campaign menu, Options three-dot button, and Export option in the Mautic Campaigns section | ||
|
|
||
| | | ||
|
|
||
| .. vale off | ||
|
|
||
| 2.\ Using the command line | ||
| ========================== | ||
|
|
||
| .. vale on | ||
|
|
||
| Use the following commands to save the exported file: | ||
|
|
||
| **1. In a specific directory** | ||
|
|
||
| .. code-block:: bash | ||
|
|
||
| bin/console mautic:entity:export --entity=campaign --id=1 --zip-file --path=path/to-file | ||
|
|
||
| **Command parameters** | ||
|
|
||
| * ``--entity``: defines the type of entity to export, in this case, ``campaign``. | ||
| * ``--id``: defines the ID of the Campaign to export. When you view or edit the Campaign, look at the URL to find the ID. 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. | ||
|
|
||
| **2. In a JSON file** | ||
|
|
||
| .. code-block:: bash | ||
|
|
||
| bin/console mautic:entity:export --entity=campaign --id=1 --json-only | ||
|
|
||
| * Creates only a JSON file and ignores any additional resources. | ||
|
|
||
| 3.\ Using Mautic API | ||
| ==================== | ||
|
|
||
| You can programmatically export Campaigns using the Mautic API. To do this, you must authenticate your API request with the credentials stored in Mautic's settings. | ||
|
|
||
| .. vale off | ||
|
|
||
| For more details on how to authenticate, see the :doc:`Authentication page </authentication/authentication>`. | ||
|
|
||
|
adiati98 marked this conversation as resolved.
|
||
| .. important:: | ||
|
|
||
| * The API uses a GET request to export a specific Campaign by ID. | ||
|
|
||
| * Before running the following cURL or Python examples, ensure you: | ||
|
|
||
| * Replace ``example.com`` with the actual Mautic instance domain. | ||
| * Replace ``YOUR_ACCESS_TOKEN`` with a valid authentication token. | ||
| * Verify that the User account has the necessary API permissions. | ||
|
|
||
| .. vale on | ||
|
|
||
| cURL example | ||
|
adiati98 marked this conversation as resolved.
|
||
| ------------ | ||
|
|
||
| .. code-block:: bash | ||
|
|
||
| curl --location 'https://example.com/api/campaigns/export/1' \ | ||
| --header 'Authorization: Bearer YOUR_ACCESS_TOKEN' | ||
|
|
||
| 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 | ||
|
|
||
| .. vale off | ||
|
|
||
| How Campaign export works | ||
| ************************* | ||
|
|
||
| .. vale on | ||
|
|
||
| Whether exporting via Mautic instance, the command line, or the API, the process follows these logic steps: | ||
|
|
||
| .. vale off | ||
|
|
||
| * **Permissions:** verifies that the logged-in User has the correct permissions to export. | ||
| * **Bulk export:** supports exporting multiple Campaigns simultaneously. | ||
| * **Data structure:** exports data in a structured JSON format to ensure compatibility. | ||
| * **Asset management:** exports Assets into a separate folder in their original format. | ||
| * **File packaging:** compresses the resulting collection of files into a single ZIP file for easy transfer across systems. | ||
|
|
||
| .. vale on | ||
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.