Jump to content


  • Posts

  • Joined

  • Last visited

Everything posted by daniels

  1. Hey, it depends on your overall website logic and what you want the user to see after the form request. I don't know the best practice and there are even some discussions right now on form submission. Just a few ways as an inspiration: - Send user to same address by removing the action="" from the form or using an anchor to make sure user lands on the right position of the page. In your template of that page, check if the form is submitted. If so, handle the MC part and then show the page. On the page you can now e.g. hide the form and show a success message – or show the form with validation errors. - Send user to a new page/template and handle the request there. Might not be just a PHP file. Make a template for it first so you can action to e.g. mywebsite.com/subscribe . Would recommend JS validation in that case, otherwise it can be annoying for the user in case of validation errors to get directed back and forth. - Use AJAX for no page loads at all. Checkout out other parts of the forum or ask your question about form handling there to maybe get better answers 🙂 Hope this helps, all the best for your site!
  2. Hey @alexm I just tried it myself again and it works perfeclty fine. I have tried it with one tag, or multiple. I can't find a difference in our code ? I'm using the same module code as here: https://github.com/danielstieber/SubscribeToMailchimp/blob/master/SubscribeToMailchimp.module So I'm not 100% sure how to help. Maybe @chcs can share his adapted module version with tag editing methods? Best Daniel
  3. Hey @chcs thanks a lot, yeah would love to add it. Can you make PR to https://github.com/danielstieber/SubscribeToMailchimp including some lines in the readme? Then I can merge it in an you will be listed as a contributor. Best, Daniel
  4. Hey @Marco Ro, you should be able to update user information with the subscribe method. If a user is already subscribed, it overwrites / sets field values. Let me know if this doesn’t work. Users can not update their mail adress though. In general, users can probably update their data and settings via Mailchimps preferences link directly in MC. The module is not meant to be a Mailchimp database editor, viewer or sync, it is mostly made to add People to MC without saving their personal data on the webspace.
  5. Hey all, open issues are fixed in 0.0.6 (changelog), you can update it now. I would strongly recommend to update it, as there were major issues regarding subscription of new users. Thanks for your help and patience! Keep me updated if you run into errors ❤️
  6. @Sevarf2 thanks for giving it a try. I'll try to reproduce your error in the next days, maybe I can find a solution. sorry for your troubles.
  7. Hey @Sevarf2, the module is using WireHttp. It seems like wirehttp introduced a curl fallback as mentioned here You could try to play around with the options of the send methods in the mailchimp module e.g. trying socket instead of auto (=curl?) as a fallback (here are the options of the send method of http wire https://github.com/processwire/processwire/blob/dev/wire/core/WireHttp.php#L434). Let me know if this makes a difference! Another possibility: Have you made the module work on that same server already? Maybe there are some serversided settings that make problems with curl.
  8. Hey @horst, @3fingers, I'm very sorry for the late response. I finally found some time to look into this. - @horst at the beginning, you mentioned a 401 error. I think this could be caused by a wrong audience id. But seems like this was no problem later? - Regarding 404: you get a 404 for every new user, because the "getStatus" method simply can't find a status for that user. This is absolutely correct behaviour and the check itself is suggested by the API documentation. I guess it is not a good idea to log this as a warning, as it is part of the normal process. I removed that. - @3fingers do you have double opt-in enabled or disabled? there was an extra 'if' on line 55 that has caused problems with resubscription when double opt-in was disabled. This should be fixed in 0.0.5. Thanks to jliebermann for posting this issue on github. (Note, that after a 'resubscribe', the user has to confirm his email adress again and will disappear in your "contacts" list until he does that!) - @3fingers your solution with updating line 54 can not really work, because the $status you are checking is not the HTTP_STATUS. It is supposed to be the subscription status, and it will be false, when you (correctly) get a 404 during the API call. So there should never be a 404 in $status ?. Besides that, I changed the wording in the readme and comments from 'list' to 'audience', since this is the new wording by Mailchimp. Version 0.0.5 is live in a minute. Appreciate your feedback. Thanks a lot for posting your issues and for your patience! Trying to answer you faster next time. Let me know if you still have problems.
  9. Hey @horst, thanks for reaching out. I have to check the details, but just on first sight: I think error B is just because of a problem at A. Line 62 is not supposed to be executed for new user. I'm very sorry, but I won't be able to look into it before Friday/Saturday due to a business trip. I made a todo and will do some testing and refactoring when I'm back. Maybe a quick and dirty fix for you meanwhile: With an if, check If you get the 404 in line 62 (patch), and if yes, execute the post request which is supposed to be executed for new users: $response = $http->send($api, json_encode($param), 'POST');
  10. No worries ? I suggest testing the subscribe function in a normal doc with test data. If this works (which should :)) try to dump your real data wherever you want to implement the subscription. If you can var_dump the right data there, you should be able to perform the subscription there ? Let me know if you have questions regarding the module itself or run into errors there.
  11. Ok @MarcoPLY , I think I got your question completely wrong ? I leave my reply anyway if someone needs it one day... Have you tried to var_dump the subscriber? What do you get there? Is the $ before country_title intentional?
  12. Hey @MarcoPLY , not sure if I get it right, but do you want to add user to specific categories? In the API naming, groups are called 'interests'. You can add them as additional parameters as in the example below. To get the interest IDs is a little pain-in-the-ass but I'll try to guide you: 1. Go to https://api.mailchimp.com/playground/ and enter your API key. 2. Click on 'Lists' and choose 'interest-categories' from the 'Subcategories' of your related list. 3. Choose 'interest' from 'Subcategories' of your related interest category 4. Now you can click on each interest and you'll get the id which should be the ID that you have to use in the 'interests' part of the example below. Please let me know if this works for you! When I find some time, I'll add a way to get these ids in the module Settings in PW admin. Example from the docs: // Work with additional parameters (not merge_field values!) $mc->subscribe('john.doe@example.com', NULL, NULL, [ 'language' => 'en', // find language list here: https://kb.mailchimp.com/lists/manage-contacts/view-and-edit-contact-languages#Language-Codes 'vip' => true, // boolean vip status 'location' => [ // geo location based on lat/log coordinates 'latitude' => '48.8722344', 'longitude', => '2.7736192' ], 'interests' => [ // subscribe user to interest categories / groups based on group id '32fec3561e' => true, '63mel4395m' => false ] ]);
  13. Ok, thanks anyway. I think it might have something to do with is_file(). I have worked around it for now ?
  14. @LostKobrakai thank you so much for your great driver, I use and love it for quite a while now. I just experienced something weird, and I'm not sure if it has to do something with valet and your driver: I'm in the need of accessing a non-processwire php file in the processwire root (e.g. domain.test/myfile.php). On my staging & live server, this works great – on my local dev environment (including valet and your driver), I land on the 404 processwire page. I tried a few things: On Staging (with valet): domain.test/myimage.png -> ✔️ domain.test/custom/myimage.png -> ✔️ domain.test/myfile.php -> ❌ domain.test/custom/myfile.php -> ❌ On Live Server (apache): domain.com/myimage.png -> ✔️ domain.com/custom/myimage.png -> ✔️ domain.com/myfile.php -> ✔️ domain.com/custom/myfile.php -> ✔️ Is it possible that it has something to do with valet and the driver? Or could there be other reasons? Best, Daniel
  15. Updated to version 0.0.4 - checkout the changelog . The Github user ml-s fixed a major issue, where you could not use a Mailchimp core function, the ADDRESS mergefield.
  16. I've just rolled out version 0.0.3 - checkout the changelog . You should be able to update without any changes in your code.
  17. Thanks for your effort @flydev, let me know if you need some updates in the SubscribeToMailchimp module. The module would not be what it is made for, if you cant use it with the loginregister or any other way a dev prefers. I just want it to stay lightweight and flexible.
  18. I've created an issue regarding features of MailChimp, that currently can't be used with the module. Also I'd like to make it more flexible, if Mailchimp roles out new stuff. My question to you: Do you currently use this MailChimp features or would like to have it in the module? - Groups (Interests) (Setup up - VIP - manually fill IP, Language and/or Location
  19. Thank you for the feedback @MarcoPLY I've not worked with loginRegister and hooks yet. If you or someone finds a solution, please share it in here ?
  20. @horst this is awesome!! Thank you, I will totally merge it in. It looks really great and is super helpful. I didn't even know, that this is possible via the module settings ? I also had a look at the issue mentioned by @Mikel . To resubscribe users (and I think this is indispensable) I had to add a getStatus method and change how the subscription method works. Now if a user resubscribes, he will get the double-opt-in mail again. I made a PR for this too, maybe you can take a look. I will merge both PRs than to version 0.0.3 (and hopefully don't mess it up .... :D) later this week. https://github.com/danielstieber/SubscribeToMailchimp/pull/2
  21. Hey @Mikel, seams like with the original mailchimp subscribe forms, it is possible (and in my opinion it should be) to resubscribe. I will have a look on that! Thanks for the input. Meanwhile (e.g. for testing) you can use the delete method to completely delete and resubscribe a user. That is working for me with the current version.
  22. Oh, that is cool. Thank you for help and clarification @LostKobrakai
  23. Hey, thanks for the feedback @giannisok and for the solution @wbmnfktr. I have just updated to version 0.0.2 with the ability to unsubscribe and delete users. I also removed the 'string' type declarations, hope it works now with your PHP version @giannisok . When I have the time I'll change my dev machine setup, so I can test with different PHP versions. But since I use Valet, I think I can only downgrade to php5.6 anyway.
  24. Sorry for rewarming this old beauty, but it was the closest answer to what I'm looking for by forum search and google. For my privacy policy and cookie information, I currently create a list of all cookies that are used by a PW-site. I'd like to provide my users an easy to understand but still informative idea of what the cookies are for. Here is an example: __utmb: Cookie by Google-Analytics that contains a timestamp of a users first visit. Together with __utmc, it can provide information about the time, a user spent on a page. Lifespan: until the end of a session For the wire cookie, I currently have: wire: Necessary cookie by ProcessWire, the CMS-system of the website. It stores and identifies a user session. Lifespan: one year Is this correct and/or can you maybe give me a hint of what I could write here, so a user gets an idea about the necessity? Thank you so much!
  25. This is a lightweight alternative to other newsletter & newsletter-subscription modules. You can find the Module in the Modules directory and on Github It can subscribe, update, unsubscribe & delete a user in a list in Mailchimp with MailChimp API 3.0. It does not provide any forms or validation, so you can feel free to use your own. To protect your users, it does not save any user data in logs or sends them to an admin. This module fits your needs if you... ...use Mailchimp as your newsletter / email-automation tool ...want to let users subscribe to your newsletter on your website ...want to use your own form, validation and messages (with or without the wire forms) ...don't want any personal user data saved in any way in your ProcessWire environment (cf. EU data regulation terms) ...like to subscribe, update, unsubscribe or delete users to/from different lists ...like the Mailchimp UI for creating / sending / reviewing email campaigns *I have only tested it with PHP 7.x so far, so use on owners risk EDIT: Since 0.0.4, instructions and changelog can be found in the README only. You can find it here ? If you have questions or like to contribute, just post a reply or create an issue or pr on github, thanks!
  • Create New...