Skip to content

docs: Port "Manipulating Contacts" extension page to 7.2#592

Open
promptless-for-oss wants to merge 3 commits into
mautic:7.2from
Promptless:promptless/docs-issue-325-manipulating-contacts-7.2
Open

docs: Port "Manipulating Contacts" extension page to 7.2#592
promptless-for-oss wants to merge 3 commits into
mautic:7.2from
Promptless:promptless/docs-issue-325-manipulating-contacts-7.2

Conversation

@promptless-for-oss

Copy link
Copy Markdown
Contributor

Open this suggestion in Promptless to view citations and reasoning process

Ports the legacy "Manipulating Contacts" developer guide into docs/plugin_extensions/manipulating_contacts.rst, converting Markdown to RST and modernizing the code for Mautic 7.x. Reading/setting the tracked Contact now uses ContactTracker, merging uses ContactMerger, and unique-identifier lookups use FieldsWithUniqueIdentifier (the old LeadModel methods were removed). Resolves docs issue #325 against the 7.2 base branch.

Trigger Events


Tip: Enable auto-create PR in your Configuration to review suggestions directly in GitHub 🤖

.. vale on

Many Plugins that extend Mautic manipulate Contacts in some way. This guide shows you how to read the currently tracked Contact and how to create and merge Contacts from your own code.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Ported the overall structure and narrative (tracking, creating Contacts, mautic_session_id/mtc_id cookies) from the legacy _plugin_manipulating_contacts.md page, per porting issue #325 and parent #324.

Source: https://github.com/mautic/developer-documentation/blob/main/source/includes/_plugin_manipulating_contacts.md

.. vale on

Reading and setting the tracked Contact
***************************************

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Replaced the legacy LeadModel::getCurrentLead()/setCurrentLead()/setSystemCurrentLead() calls with ContactTracker::getContact(), getTrackingId(), setTrackedContact(), and setSystemContact(), since those methods now live on ContactTracker in Mautic 7.x.

Source: https://github.com/mautic/mautic/blob/7.x/app/bundles/LeadBundle/Tracker/ContactTracker.php


Creating and merging Contacts
*****************************

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

UPGRADE-6.0.md documents that FieldModel::getUniqueIdentiferFields/getUniqueIdentifierFields were removed in favor of FieldsWithUniqueIdentifier::getFieldsWithUniqueIdentifier, so the create-and-merge sample uses FieldsWithUniqueIdentifier instead of the legacy LeadModel/FieldModel call.

Source: https://github.com/mautic/mautic/blob/7.x/UPGRADE-6.0.md

@adiati98 adiati98 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@promptless-for-oss please address the suggestions.

Comment thread docs/plugin_extensions/manipulating_contacts.rst Outdated
Comment thread docs/plugin_extensions/manipulating_contacts.rst Outdated
Comment thread docs/plugin_extensions/manipulating_contacts.rst
Comment thread docs/plugin_extensions/manipulating_contacts.rst Outdated
- Rewrite the leads terminology note in active voice
- Remove the vale off/on wrapper around that note (format 'leads' as inline code to stay Vale-clean)
- Wrap the 'Reading and setting the tracked Contact' heading in vale off/on per reviewer suggestion
- Add 'The' before mautic_session_id in the cookie paragraph per reviewer suggestion
@promptless-for-oss

Copy link
Copy Markdown
Contributor Author

Thanks for the review, @adiati98 — all four comments have been addressed in this PR:

  1. Active voice — the terminology note now reads in active voice.
  2. Removed the .. vale off/.. vale on wrapper around that note. To keep Vale clean without the suppression, "leads" is now formatted as inline code, which satisfies the Mautic.FeatureList rule.
  3. Wrapped the "Reading and setting the tracked Contact" heading in .. vale off/.. vale on (applied verbatim).
  4. Added "The" before mautic_session_id in the cookie paragraph (applied verbatim).

Vale passes on docs/plugin_extensions/manipulating_contacts.rst. Ready for another look.

Comment thread docs/plugin_extensions/manipulating_contacts.rst Outdated
Address @adiati98's review comment on PR mautic#592: the legacy 'content
requires a major update' placeholder note no longer applies now that the
Manipulating Contacts page has full ported content. Removes the note and
its wrapping vale off/on directives.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants