Mauticform prefill#1
Open
jordan8037310 wants to merge 15 commits intobadri:7.xfrom
Open
Conversation
Thanks to @moreonion for work on webform_prefill Now, you can prepopulate an embedded Mautic form in Drupal page by passing form keys as Hash params in the URL e.g. /your-form-url#p:email=jordan@facetinteractive.com&city=manhattan beach # Use Case Our use case was we needed to prepopulate fields when progressive profiling for users when they submit an initial newsletter subscription form. # Redirecting from Other Forms If you’re passing inputs to the url via another Mautic form , you will need to HTML encode the param inputs in the URL Redirect Link, e.g. /your-form-url#p:email={formfield=email|true}&city={formfield=city|true}, where |true is the boolean for turning on HTML encoding. Included code from the fork may be excessive. I made the smallest number of changes possible in order to get this working. @todo - Look at LocalStorage instead of Session Storage @todo - Perhaps consider incorporating this in Mautic Core instead of Drupal module so that prefill functionality is consistent across all embeds.
…er third party tools in Drupal
Tracking Pixel, Shortcode Embed Forms, Shortcode Embed Dynamic Content
Fix Help Text per recent changes to 7.x
Appropriate fix to trim trailing slash on domain.
Mautic Config Path in Drupal Admin
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Mautic form pre-filling using hashparams in the URL.
Issue: #26
Test:
/your-form-url#p:email=email@somedomain.com&firstname=John&lastname=DoeThis is a fork of work originally done for webform_prefill. Rather than trying to generalize that module I used the same JS approach for Mautic.
Note: Requires jquery_update