Hi,
I was building something small to be able to add users to the system externally, of course I used the remotebridge plugin as provided.
Now I was wondering whether it would be possible for it to send out the welcome mail. I couldn't find an API-option in the Wiki so I went searching in the i-MSCP core how this works.
Wouldn't it be nice to be able to add a notify function for new users (an extra array-entry of $dataToEncrypt, notify_user) ? So they get that welcome mail, password changed mail or whatever action is performed.
This example could be implemented for just welcome emails.
Below line 939 and onwards in remotebridge.php
- iMSCP_Events_Manager::getInstance()->dispatch(
- iMSCP_Events::onAfterAddDomain,
- array(
- 'domainName' => $dmnUsername,
- 'createdBy' => $resellerId,
- 'customerId' => $recordId,
- 'customerEmail' => $userEmail,
- 'domainId' => $dmnId,
- 'firstName' => $firstName,
- 'lastName' => $lastName
- )
- );
- // let's send mail to user (from i-mscp core)
- send_add_user_auto_msg($resellerId, $dmnUsername, $password, $userEmail, $firstName, $lastName, tr('Customer', true));
- send_request();
Now some of these are not being set yet, like first and last name, neither does the tr function work.
onAfterAddDomain should then include first and last name too.
Would this be an idea?