Description

This function retrieves the notification email address.

Examples 


https://hostname.example.com:2087/cpsess###########/json-api/cpanel?cpanel_jsonapi_user=user&cpanel_jsonapi_apiversion=2&cpanel_jsonapi_module=Cron&cpanel_jsonapi_func=get_email

$cpanel = new CPANEL(); // Connect to cPanel - only do this once.
 
// Retrieve the notification email address for cron.
$dear_strongbad = $cpanel->api2(
    'Cron', 'get_email'
);

 

my $cpliveapi = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.
 
# Retrieve the notification email address for cron.
my $dear_strongbad = $cpliveapi->api2(
    'Cron', 'get_email',
);

cpapi2 --user=username Cron get_email 

{
  "cpanelresult": {
    "apiversion": 2,
    "func": "get_email",
    "data": [
      {
        "email": "user@example.com"
      }
    ],
    "event": {
      "result": 1
    },
    "module": "Cron"
  }
}

Parameters

This function does not accept parameters.

Returns

ReturnTypeDescriptionPossible valuesExample
emailstringThe cron daemon's notification email address.A valid email address.user@example.com
reasonstring

A reason for failure.

This function only returns a reason value if it failed.

A string that describes the error.

This is an error message.
resultBoolean

Whether the function succeeded.

  • 1 — The function succeeded.
  • 0 — The function failed.
1