E-Mail Notification When A New Customer Registers

Hello,

How can I get notified by email when a new customer registers? All of the information that I have found is outdated and doesn’t seem to apply. I am using version 4.17.1.

Please make sure that the “Profile was created” notification is enabled in the Administrator notifications (Administration → Notifications)

Hello,

Thank you for assisting me, but that option is not available in notifications. Maybe there is something that I am missing, but from what I see profile notifications is the only section on administration notifications that we can’t manage.

As far as I can see from your screenshot, the setting is enabled. Please check the Settings → Company → User department e-mail address value

Hi!

The only way to receive notifications about newly created users is to enable the Administrator must activate new user accounts settings at the Settings > General settings page.

So what does the “Profile was created” option means in the administrator notifications?

Thank you. Yes that setting has my admin email address as the value.

Thanks, but I am aware of this and this is a problem. No one wants to create an account and have to wait for someone to activate it.

This setting means that the user will receive an email notifying them that they have set up a profile. But I, as the admin, have no idea that someone has created an account or signed up for my newsletter if they check the box to receive a newsletter.

1 Like

The creation of the new administrator account. The registered administrator will receive this notification.

1 Like

There are no notifications about these cases, as they can simply flood the recipient’s email and lead to the mail server used to send them being added to the list of spammers.

I am sorry, but I just don’t agree with you. When a customer visits my site and they take the time to register or want my newsletter; I don’t want to delay them by making them wait for an activation. I can understand a vendor needing to be approved and activated, but a customer is different. When I signed up for CS-Cart, there was no delay in getting a demo sent to me. It was sent immediately, because a delay may have caused me to look into other shopping carts. If you look through this forum, you will see plenty of people who have inquired about this issue, because they want to have those options available to them.

Since CS-Cart is the platform with open source code, you can develop the required feature for your store :slight_smile: Currently I cannot agree that this feature will be valuable for everyone and the amount of similar requests for the last 5 years tends to zero, to be honest.

I understand that I can develop my own code. That is the reason why I came into the forum looking for assistance. The reason no one has asked in the last 5 years is because they found the same outdated info that I found and decided to try to use it. I was looking for more updated info. This is something that I have wanted for years also, but never requested. I have found a work around, but it just creates more work for me and was looking for an easier solution. The more time I have to spend on trying to figure out CS-Cart, the less time I have to market and make sales, which leads to less profit. The less profit I have, the less money I can spend on CS-Cart and their vendor’s products. :slightly_smiling_face:

Thanks for the explanation :slight_smile:

In this case I can give you the recommendations how add notifications for the marketplace administrators about new users.

If you need a completely separate notification, you will require to create a new email notification template. The comprehensive article about this, can be found here:

But if you or OK with using the default Profile was created template, you can skip this part.

Now let’s get to the part where you can set up what data will be available in the template, to whom the notification will be sent, from who, etc. I’d like to recommend this article for the details:
https://docs.cs-cart.com/latest/developer_guide/core/event_notifications.html

You can extend the existing app/schemas/notifications/events.php scheme and add a new event, for example:

<?php

use Tygh\Enum\SiteArea;
use Tygh\Enum\UserTypes;
use Tygh\Notifications\DataProviders\ProfileDataProvider;
use Tygh\Notifications\DataValue;
use Tygh\Notifications\Transports\Mail\MailMessageSchema;
use Tygh\Notifications\Transports\Mail\MailTransport;

$schema['profile.created.n'] =
[
    'group'     => 'profile',
    'name'      => [
        'template' => 'event.profile.created.name',
        'params'   => [],
    ],
    'data_provider' => [ProfileDataProvider::class, 'factory'],
    'receivers' => [
        UserTypes::ADMIN => [
            MailTransport::getId() => MailMessageSchema::create([
                'area'            => SiteArea::ADMIN_PANEL,
                'from'            => 'company_users_department',
                'to'              => 'company_users_department',
                'template_code'   => 'create_profile',
                'legacy_template' => 'profiles/create_profile.tpl',
                'company_id'      => 0,
                'to_company_id'   => DataValue::create('user_data.company_id'),
                'language_code'   => DataValue::create('user_data.lang_code', CART_LANGUAGE)
            ]),
        ],
    ],
];

return $schema;

And dispatch this event using the update_profile hook. Something like this:

function fn_my_changes_update_profile($action, $user_data, $current_user_data)
{
    if ($action !== 'add') {
        return;
    }
    $event_dispatcher = Tygh::$app['event.dispatcher'];
    $storefront = Tygh::$app['storefront'];
    $storefront_id = $storefront->storefront_id;
    array_walk($user_data, static function(&$element, $key) {
        if ($key === 'password' || $key === 'api_key') {
            $element = '';
        }
    });
    $event_dispatcher->dispatch(
        'profile.created.n',
        [
            'user_data'     => $user_data,
            'storefront_id' => $storefront_id,
        ]
    );
}

I hope it will help you.

1 Like

Thank you for your assistance. It is greatly appreciated!