Automated email request and removal

Sebastian Ng

Member
May 2, 2017
16
4
3
Penang, Malaysia
cPanel Access Level
Root Administrator
Hello members and staffs,

Do anyone here created an automated email request simply app for internal use,
like create a website, login authenticate using email and password, request for new account for your staff, fill in forms like name, new email account name, secondary personal email for password notification, cell phone number for sms to get notify, approval your superior. then submit.
The form will notify your superior approval via sms and email, once approve will notify you and your new staff via sms and email.

and if a staff resign, during exit interview or resign approval, their email auto forward to their superior, auto respond to senders say this person no longer with the company please send to their superior, and remove their email account.

i believe this can be done using cpanel uapi, php, mysql with some logics plus company policies.

I need help to do this, i am stuck with the uapi authentication side.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,904
2,226
463
Hello,

I'm not aware of any third-party applications that offer that specific functionality, but I'm happy to help answer any questions you have about cPanel UAPI functions. Could you let us know what in-particular you are stuck with?

You can also find a list of system administration services on the following URL if you would like to hire someone to help develop a custom application for you:

System Administration Services | cPanel Forums

Thank you.
 

Sebastian Ng

Member
May 2, 2017
16
4
3
Penang, Malaysia
cPanel Access Level
Root Administrator
Good morning,

I notice that xml-api that i use for uapi that is apiversion=3 have depreciated.
I plan to use verify_password for webmail as i making login page that uses webmail username and webmail password have depreciated, is there any other alternative?
My plan is to allow webmail user request new email account for their subordinate, send an email notification to their direct superior to approve the request. Once approve a new email account will be created and a new notification will reply the requestor and also sms to the subordinate on the login page link, username and password.

If a person resign or absconded, HR will login to the login and trigger email account removal, autoresponder and forward future email to their superior.

Now my problem i do not know how to use verify_password in UAPI. Please advice.

Regards,
Sebastian
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,904
2,226
463
Hello Sebastian,

You can find more information about the deprecation of the XML-API output of cPanel APIs at:

March Development Update | cPanel Blog

Here's the relevant section:

  • XML-like output of APIs
    The XML-like output of our API (often called the XML API) is already officially deprecated, and cPanel & WHM Version 70 will be the last version to support this output. Integrators and API users will want to begin switching to use the JSON output of the API now. The XLM-like format has long caused problems for integrators and developers because it is not valid XML, and we find that removing it completely will help reduce that.
You can find documentation on this UAPI function at:

UAPI Functions - Email::verify_password - Software Development Kit - cPanel Documentation

This includes an example of the JSON output.

Thank you.
 

Sebastian Ng

Member
May 2, 2017
16
4
3
Penang, Malaysia
cPanel Access Level
Root Administrator
I have found this tutorial
Tutorial - Create a New Paper Lantern Interface in PHP - Software Development Kit - cPanel Documentation
I hope can learn some thing from it.

<?php
include("/usr/local/cpanel/php/cpanel.php"); // Instantiate the CPANEL object.
$cpanel = new CPANEL(); // Connect to cPanel - only do this once.
print $cpanel->header( "Page Heading" ); // Add the header.
?>

<?php
$get_userdata = $cpanel->uapi( // Get domain user data.
'DomainInfo', 'domains_data',
array(
'format' => 'hash',
)
);
?>

<?php
print $cpanel->footer(); // Add the footer.
$cpanel->end(); // Disconnect from cPanel - only do this once.
?>