This object is in archive! 

How to call a function RIGHT AFTER the UseResponse registration email is sent out?

Archived Dan Baritchi 11 years ago

Hi guys!


We are getting ready to launch the UseResponse forums for our high traffic site Ask Dan & Jennifer.


However, it is very important for us that EVERY person who signs up for this UseResponse forum site is ALSO added to our email list, which is managed by our email marketing provider, MailChimp.


I have done the research, and MailChimp has a very simple API, and I believe it can easily be integrated with UseResponse.


I have the code that is required, see the 2 files attached:

  • MCAPI.class.php - the full MailChimp API file
  • store-address.php - the function we wrote to add subscribers to our MailChimp email list

The function to call is in store-address.php, and the call is very simple, requiring just these 2 parameters: name and email of the subscriber.

  1. storeAddressDirect($subscriber_email, $subscriber_full_name);

Here is the question:


How can we call this function RIGHT AFTER the UseResponse Registration email ("welcome, here's your login/password") is sent out?


Thanks!Dan


P.S. in case you are curious about why we require this, here's a bit of clarification:

For us email marketing is a big part of our business, and we manage over 25,000 subscribers with MailChimp already for maximum deliverability, flexibility, etc.


We are aware of the UseResponse newsletter feature, and while that will be useful for some people who don't have a full email marketing effort already, this is not an option for us because we already have this service with MailChimp, and we are very happy with their service. :-) We do not want to manage our email campaigns in 2 different places.

Best Answer
photo

Hi, Dan

You can attach you own handler on afterRegistration event.

See /application/modules/system/handlers/Events.php method:

  1. public static function onAfterRegistration ($user)

Here you can take access on @param System_Model_User $user variable that is newly registered user object. Use $user->email to take email.


Good luck!

Replies (4)

photo
1

Hey guys! just following up on this. :-)


Thanks so much!Dan (and Jennifer)

photo
1

Hi, Dan

You can attach you own handler on afterRegistration event.

See /application/modules/system/handlers/Events.php method:

  1. public static function onAfterRegistration ($user)

Here you can take access on @param System_Model_User $user variable that is newly registered user object. Use $user->email to take email.


Good luck!

photo
1

Hi Paul!


That's great news that a handler is available to call for this!


My PHP skills are not very good. Do you have an example you could send me? :-)


We think this would be a great Extra for UseResponse.


Any chance you could "package" this as an Extra (the 2 PHP files I sent above plus however to call this handler) - and we'll be happy to upload it to the UseResponse Extras area?


I am familiar with MailChimp and their API so I can test it, no problem - just need the connection to the UseResponse code. :-)


Thanks!

Dan

photo
1

Dan,


Unfortunately, we are currently loaded with work, and can't get this done during next 2 weeks.

It's a bit out of support as it's custom development. You can ping us in about 2 weeks so we could implement it for you on custom basis.

As of now you can use import of users from PHPMYAdmin in csv format to port it easily into MailChimp

Replies have been locked on this page!