-
Notifications
You must be signed in to change notification settings - Fork 53
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
[feature request] shortcode for user counter #114
Comments
Hello ! This seems an interesting idea, if you want to contribute, I'll be glad to review your code ^^ |
im willing do this, when i find time |
So i was thinking of: I think this can ALL be done with this mautic api call and ONE wordpress shortcode: [mautic type="contacts" search="thesearchstring" display="list" limit="10" where="where_x=y|where_x=y|where_x=y|where_x=y|where_x=y" orderBy="first_name" orderbydir="desc"] [mautic type="contacts" search="thesearchstring" display="count" where="where_x=y|where_x=y|where_x=y|where_x=y|where_x=y" orderBy="first_name" ] I would extrapolate that one shortcode and function to create these shorter shortcodes but that one function above would handle these too: [mautic type="tags" display="list" ids="2.4,6" limit="10" ...] ids: can be id or name (if api call supports both) Have a default style and allow developers to use a template include wp hook to change the style. Finally too boot lets allow this function I create to return an array for developers who want to use it: function mautic_search(,,,,,,,,,,,$return_type) The only crappy part of this, correct me if im wrong, is I think we need to have an oauth 2.0 authentication feature to do this. The shortcode is quite simple but oauth is a ui feature and a 3 step process plus a cron to keep the token fresh. FYI, I assume this is what can be done with that api call search param:
Search commands |
Ok, this looks good. However, the main point is not implementing the Shortcode for me. If we introduce this feature, we'll require to add an HTTP client to communicate with the Mautic API. That's my main concern here, today we don't use this API in the plugin so be careful if you work on an implementation to clearly decouple the API call from the code itself. |
I decouple/loosely couple everything I do lol. I can implement a simple api call using curl. I don't even need to introduce a dependency. The oauth part is the part im not sure how to decouple. I was actually thinking of creating a seperate oauth authentication plugin for all wordpress devs who need it. Then have hooks for devs to use it. We could do that and require this for that plugin to work? Seems a bit obtuse to do that. So maybe if you want to keep it totally separate I can make this another plugin for your plugin and have both oauth and this search in that new child plugin and we can maintain it separately? I may need a single hooks from you to get it done such as grabbing the mautic url but i will use it only if your plugin is installed....otherwise i will have my own mautic url field too. |
A code which can show the total number of users in a segment or tag, or platform total.
Inspired in https://wordpress.org/plugins/contacts-in-mautic/
Eg.
[mautic tagscount=2]
[mautic segmentcount=1]
[mautic contactscount]
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
The text was updated successfully, but these errors were encountered: