Email Admin when user account has been activated

Permalink
Once user gets activation email and activates their account, I want to do following with new user information:

1. send an email to admin
2. also post a form on the web automatically

User information such as:
1. user id
2. pwd
3. email
4. user group
5. datetime user was activated

How can this be achieved?

I am new to concrete5 and new to php as well.

 
mnakalay replied on at Permalink Reply
mnakalay
Sending an email to the admin is included in concrete if you set the option in system and settings under registration.
For the other thing, that data is saved against the user account and you can access it through the dashboard under members and going to search users.
contact4savings replied on at Permalink Reply
Which version of Concrete5 are you referring to? I am using 5.5.0

Also, I want to post data to an external form automatically after the user is activated. I am not sure how to achieve that programmatically!!!
mnakalay replied on at Permalink Reply
mnakalay
Any version from 5.5 to the latest would be ok.

Concerning posting the data to an external form, I am not sure either.
All you would ask from C5 is to send the data to a remote address, the actual processing and all the heavy lifting would have to take place wherever the data is sent.

If you are referring to a commercial customer management type of website ot the like, they might provide an api to send data to their database. A website like Aweber for instance makes that easy.
If you are referring to another personal website than you will have to do a lot of coding.
contact4savings replied on at Permalink Reply
How would you ask C5 to post data to remote form automatically!!!

I could think of 2 ways to do it programmatically but both require some sort of coding in php and I am not a php person.
1. use User_activated event and the php will post data to a external form on another website
2. write a cron job which will fire every 15 mins and the php file will grab any user activated in past 15 mins and post the form

Not sure if this is really doable but any help is appreciated.
mnakalay replied on at Permalink Reply
mnakalay
I would go with option 1 if you are going to get a few registration a day (say 50) and option 2 if you're expecting a lot of daily registrations but then once every 6, 12, or 24 hours is probably enough.

But once again, the problem is not on this side, the problem is on the other side, the receiving end. That's where the coding is going to be tricky.
contact4savings replied on at Permalink Reply
Coding on other side is done, if you can provide me how to do this on C5 side automatically, where by the new activated user data is posted to an external form then I am all set....
mnakalay replied on at Permalink Best Answer Reply
mnakalay
You would have to hook into the on_user_add event to send the data when the event is fired, however at this point you would only have access to the user ID, name, email and date, probably not the group. For that you might have to hook into on_user_enter_group.

Here's a link to explain events and how to hook into them:
http://www.concrete5.org/documentation/developers/system/events...

Those events will return a UserInfo object which is the object that contains all the data you want to send.
On the following page you will find all the info you need to get the user's ID, name, email, and date. Be careful, you want to look at the second part of the page about the UserInfo object, not the first part about the User object.
The link is:
http://www.concrete5.org/documentation/developers/permissions/users...

Now to understand how you can all put it together, I suggest you download the free add-on "registrant group". It uses the on_user_add event to put users in a specific group upon registration. By looking into it and with minimal modifications, you can make it gather all the data you need.

Once you have that, how to send it to its final destination is totally up to you as I have no idea what code you have already on the other end.
contact4savings replied on at Permalink Reply
Thanks for reply, I am not sure how to do this programmatically and any help is appreciated.

Thanks for your suggestions.
mnakalay replied on at Permalink Reply
mnakalay
That would take some time and energy and I would need to know more about what's happening on the receiving end.
I'm ready to discuss a paid collaboration if you want but to be honest I am pretty busy at the moment.
contact4savings replied on at Permalink Reply
Thanks, at the moment I am already trying to device a solution to fit my needs but will get back to you if it doesn't work out.