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

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

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • 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.
    • By Sergio
      I have this "editor" role, that has the "user-admin-all" permission.
      I tried several times, doing different things sets of permissions, but I can't make a user with this role being able to make another user an "editor" too. PW disables the "editor" checkbox. I read the documentation 3 times that my eyes cannot see what I'm missing anymore.
      Any clues?
    • By zaib
      In PW I created a user 'tester' and gave the access to create edit and new. Issue is I'm unable to see 'edit' link in front of each page link and pages that i want to edit is already created.
      any help in this will be great help.
       
      Thank you.