Jump to content
benbyf

Work in progress modules Subscribers / WireMailChimp

Recommended Posts

Thought I'd show some work in progress modules.

Subscribers https://github.com/benbyford/Subscribers

  • has functions for logging in new users,
  • added with new subscriber role
  • bulk export the subscriber users to comma delineated
  • SubscriberList (submodule)
    • module adds an admin page to view your subscribers and page through them, or export

WireMailChimp https://github.com/benbyford/WireMailChimp

(though I need to change the name on github)

Implements https://github.com/drewm/mailchimp-api

  • adds any user save to a mailchimp list
  • settings for API and List id
  • only adds users that have a checked email_subscribe field to true

 

  • Like 13

Share this post


Link to post
Share on other sites

hi ben,

would you mind adding some screenshots or even better screencasts so that all of us get an idea what your module does immediately?

tools for screencasts i recommend are licecap (gifs) or www.screencast-o-matic.com

thank you

Share this post


Link to post
Share on other sites

I've been able to start adding some text to the Readme's for these two now. Please get involved if you're interested in helping with these two specific modules as im still relatively new at it.

  • Like 1

Share this post


Link to post
Share on other sites

Hi, Ben,

I just looked ino the WireMailChimp module: It does require the Subscribers module, doesn´t it?

For my needs I altered the part whre this module is loaded and the role "subscriber" is checked. (I just run a check against my own subscriptions field)

I will then allways get the same error message, no matter if subscribing or unsubscribing:
400: [EMAILADRESS] is already a list member. Use PUT to insert or update list members.

Did you already got it to work properly?

  • Like 1

Share this post


Link to post
Share on other sites

@Mikel nice implementation, no it doesn't need the subscriber module, just change the role to something that is present in your system - I chose subscriber as my role.

I added a checkbox to the user template and check against it when trigging the module. Soooo when the checkbox is false it sends their email to mailchimp and I change to true. now if it trys to check again the checkbox field will be true and it wont send to mailchimp.

Share this post


Link to post
Share on other sites

im looking to revamp the Subscribers module soon and create a site to show its implememtation - I was thinking a simple job listing CV site unless someone could think of anything better?

  • Like 2

Share this post


Link to post
Share on other sites

Hi. I'm trying to install the WireMailChimp module, but I'm getting an error when I install:

"parse error (line 73 of /Users/paul/Sites/pw-projects/site/modules/WireMailChimp/WireMailChimp.module)"

I'm using PW 2.7.2. Any ideas why?

Share this post


Link to post
Share on other sites

Hi @strandoo have you added a mailchimp List ID in the module settings? looks like the line erroring is trying to send to a list (you have to add a mailchimp for the users to be subscribed to)

Share this post


Link to post
Share on other sites

Hi @benbyf. Well, I first got the error when I tried to install the module, so I never got far enough to enter a List ID (or any other settings). I then commented out lines 73-76 (and 82-85 when I got the same error) and was able to install the module and insert API and List ID. But when I uncommented the lines, I get the same error.

Share this post


Link to post
Share on other sites

Ok, I got it. It turns out it's because this particular site is still using php v5.3.x which doesn't like the "Array Initialization Construct: []" I've worked around it by using "array(" instead:

                    $result = $MailChimp->post("lists/$list_id/members", 
                        array(
                        'email_address' => $page->email,
                        'status'        => 'subscribed',
                    ));

Cheers,
Paul

  • Like 1

Share this post


Link to post
Share on other sites

Moved to Module/Plugin Development  forum since these are work-in-progress and do not yet have support forums.

Share this post


Link to post
Share on other sites

Does this still work? I've installed it, but when I create new accounts with the correct role it doesn't add to to the mail list.

Share this post


Link to post
Share on other sites

@alexmercenary should do. I've been creating the users on the frontend, so not sure but if your creating users in the admin it may not work.

Also which module are you referring to specifically?

Share this post


Link to post
Share on other sites
3 minutes ago, alexmercenary said:

@benbyf I'm using WireMailChimp and using it in conjunction with Login/Register to create accounts on the front end.

Cool. I think it only signs up users with role "subscriber" set, or a different role setup in my subscriber module (not required). So you can change this in the code, or add the role when they register.

They also must have a vaild email, and mailchimp API keys and list name setup in the module config

Share this post


Link to post
Share on other sites

Hmm yeah I did that. I changed it in the module to login-register and set the api key and list id but it doesn't seem to add the users. I've also added a checkbox called email_subscribe. Strange.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By AndZyk
      Hello,
      this maybe a simple question, but it bothers me for a while now:
      There used to be a warning, if two or more user try to edit the same page. But ever since AdminThemeUIkit I haven't seen it any more.
      Is this a bug or are there special circumstances under which the warning will be displayed?
      If I am logged-in in the same browser with one default and one privat window, I don't see this warning. But also different browsers on different machines in the same network don't see this warning.
      I was looking for the blog post on which this feature was announced, but couldn't find it anymore.
      We had the case, that two people were writing a text for the same page, but after person A saved the page first, the text of the person B was lost. I know we could have used ProDrafts for this case, but it shouldn't happen in the first place.
      I would appreciate some feedback. 😀
      Regards, Andreas
    • By SwimToWin
      I have a website that allows users to create their personal "website" (a page with sub-pages).
      Users shall be able to:
      Log in (frontend and/or admin), Edit "their" page(s) - I am using the "Page Edit Per User"-module (https://modules.processwire.com/modules/page-edit-per-user/) to grant access to the relevant pages Create child pages - possible? Users shall not be able to see other pages in the admin interface - "Admin Restrict Page Tree" may do the trick (https://modules.processwire.com/modules/admin-restrict-page-tree/)? Frontend editing shall be possible - I am considering "Fredi" (https://modules.processwire.com/modules/fredi/) for this. The challenge is that it takes a lot of modules and configuration.
      Is there a way to set this up that doesn't require a lot of configuration for each new user?
    • By benbyf
      Hello, having trouble getting PW to save my user or field in cron hook.
      It seems to report the same field info each time unchanged. It should be counting down in seconds.
      public function init() { // set to every30Seconds in settings $this->defaultInterval = $this->cron_check; // add hooks to CRON $this->addHookAfter("LazyCron::{$this->defaultInterval}", $this, 'checkUserSubscription'); } public function ___checkUserSubscription(HookEvent $e){ // seconds since last lazycron $seconds = $e->arguments[0]; $log = wire('log'); $field = $this->exclusiveRole; // users with specific role and field $users = $this->users->find("roles=$field"); foreach ($users as $user) { // get stored time $currentTime = $user->get($this->fieldName); // if time not null if($currentTime){ // evalute stored time minus time past $resultTime = intval($currentTime) - intval($seconds); $log->message("result ".$resultTime); // save user page $user->set($this->fieldName, $resultTime); $this->users->save($user); } } }  
    • By benbyf
      HELLO! having user Role issues.
      I've got a Role:  members and a template that is set to only allow view of Members and to redirect anyone else to / but id redircts Member users still currently, and only alows people to view the page if the template is set to view on the guest role also.
      Any help would be appreciated. I'm running  ProcessWire 3.0.62



    • By MrKing
      Hi,
      I am hoping to be able to use processwire for a charity with over 900 members and about 90 interest groups.
      One of the deciding factors (and there are many) is whether I would be able, as the admin, to add all my existing members, all the interest groups and all the group membership data programatically. As you might imagine, I would not want to do this by hand.
      I have written data upload scripts for a 'home brewed' experimental site but would much prefer to use processwire as the foundation of our site, if possible.
      Many thanks.
×
×
  • Create New...