Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

Admin Notification On New User Registartion Rate Topic   - - - - -

 
  • sarathlal
  • Advanced Member
  • Trial users
  • Join Date: 04-May 16
  • 57 posts

Posted 31 May 2016 - 12:55 PM #1

How I can get admin notification on user registration?

 

The current CS Cart version is 4.3.

 

Thanks in advance.



 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 19775 posts

Posted 31 May 2016 - 01:57 PM #2

You should receive notifications to the e-mail specified in the following setting:

 

Settings -> Company -> User department e-mail address


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 
  • sarathlal
  • Advanced Member
  • Trial users
  • Join Date: 04-May 16
  • 57 posts

Posted 01 June 2016 - 07:08 AM #3

Thanks @eComLabs for your help.
 
I have added the email. Now the from address of the New User Notification to new user was changed with this email.
 
But there is no notification send to user department e-mail address.
 
Is there any configuration to enable / disable notification for department?


 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 19775 posts

Posted 01 June 2016 - 07:45 AM #4

Hm.. I do not see this feature anymore. Try to open the app/functions/fn.users.php file and add

            if (AREA != 'A')
                Mailer::sendMail(array(

                    'to' => 'company_users_department',
                    'from' => 'company_users_department',
                    'reply_to' => $user_data['email'],
                    'data' => array(
                        'user_data' => $user_data,
                    ),
                    'tpl' => 'profiles/create_profile.tpl',
                    'company_id' => $user_data['company_id']
                ), 'A', Registry::get('settings.Appearance.backend_default_language'));
            }

after this line of code:

                fn_set_notification('N', __('information'), __('text_profile_is_created'));

if you are familiar with hooks, please use the update_profile hook in the fn_update_user function


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 
  • sarathlal
  • Advanced Member
  • Trial users
  • Join Date: 04-May 16
  • 57 posts

Posted 01 June 2016 - 12:33 PM #5

Thanks @eComLabs for your great helps.

 

Your code works in version 4.3.

 

How I can edit the email template profiles/create_profile.tpl?

 

Basically I want to use a new email template and subject template for this admin notification.

 

If I edit email template in design/themes/my_theme/mail/templates/profiles/create_profile.tpl, there is no changes happening for admin notification. I think the location is entirely different.



 
  • The Tool
  • Been Here Way Too Long Member
  • Members
  • Join Date: 30-Mar 07
  • 3842 posts

Posted 01 June 2016 - 01:41 PM #6

/design/backend/mail/templates/profiles/create_profile.tpl



 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 19775 posts

Posted 01 June 2016 - 01:43 PM #7

The tool is right. Admin e-mail templates are located in the separate folder:

 

design/backend/mail/templates


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 
  • sarathlal
  • Advanced Member
  • Trial users
  • Join Date: 04-May 16
  • 57 posts

Posted 02 June 2016 - 04:13 AM #8

Thanks to The Tool & eComLabs.



 
  • sarathlal
  • Advanced Member
  • Trial users
  • Join Date: 04-May 16
  • 57 posts

Posted 07 June 2016 - 12:47 PM #9

Can any one help me to make it as an addon? If so, I can avoid core file editing.  :-(



 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 19775 posts

Posted 07 June 2016 - 02:08 PM #10

Just use the update_profile hook in the app/functions/fn.users.php file. Find more info about hooks here:

 

http://docs.cs-cart..../php_hooks.html


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 
  • sarathlal
  • Advanced Member
  • Trial users
  • Join Date: 04-May 16
  • 57 posts

Posted 09 June 2016 - 05:53 AM #11

Thanks eComLabs for your support.

 

I have created that addon.

 

https://github.com/S...up-notification

 

But I need some more help.

 

I like to use new email template and subject for this admin notification. So I have added these .tpl files in  /design/backend/mail/templates/profiles/.

 

But in design/backend/mail/templates, I have found there is one addon directory and there is some email templates inside addon_id's folder. So for my addon, I like to use email template from this addon folder instead of /design/backend/mail/templates/profiles/.

 

My mailer function is given below.

                Mailer::sendMail(array(

                    'to' => 'company_users_department',
                    'from' => 'company_users_department',
                    'reply_to' => $user_data['email'],
                    'data' => array(
                        'user_data' => $user_data,
                    ),
                    'tpl' => 'profiles/create_profile_admin_notification.tpl',
                    'company_id' => $user_data['company_id']
                ), 'A', Registry::get('settings.Appearance.backend_default_language'));

What the changes I have to made on my code to use email template from /design/backend/mail/templates/addons/csc_signup_notification where csc_signup_notification is my addon_id.



 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 19775 posts

Posted 09 June 2016 - 07:02 AM #12

Put your templates to the following directory:

 

design/backend/mail/templates/addons/csc_signup_notification/profiles

 

and use the following code to use them:

'tpl' => 'addons/csc_signup_notification/profiles/create_profile_admin_notification.tpl',

GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 
  • sarathlal
  • Advanced Member
  • Trial users
  • Join Date: 04-May 16
  • 57 posts

Posted 09 June 2016 - 08:53 AM #13

Thanks @eComLabs.

 

I have updated the code.

 

Download Link