### Module Installation Steps (Bash) Source: https://context7.com/namecrane/cranemail-blesta-module/llms.txt Provides instructions for installing the Namecrane Mail module in Blesta, including file copying, directory structure overview, and initial configuration within the Blesta admin panel. ```bash # 1. Upload module to Blesta installation cp -r namecrane_mail /path/to/blesta/components/modules/ # 2. Directory structure after installation: # components/modules/namecrane_mail/ # ├── apis/ # │ └── namecrane_mail_api.php # ├── config/ # │ └── namecrane_mail.php # ├── language/ # │ └── en_us/ # │ └── namecrane_mail.php # ├── views/ # │ └── default/ # │ ├── add_row.pdt # │ ├── edit_row.pdt # │ ├── manage.pdt # │ ├── dns_records.pdt # │ ├── login_details.pdt # │ ├── resource_usage.pdt # │ ├── spamexperts_sso.pdt # │ └── images/ # │ └── logo.png # ├── config.json # └── namecrane_mail.php # 3. Configure in Blesta Admin: # - Navigate to Settings > Modules > Available # - Install "Namecrane Mail" # - Add Server with API key from Namecrane reseller portal # - Create packages specifying Namecrane Mail as the module ``` -------------------------------- ### Module Installation Source: https://context7.com/namecrane/cranemail-blesta-module/llms.txt Steps for installing and configuring the Namecrane Mail module with Blesta. ```APIDOC ## Module Installation ### Description Installation and server configuration steps for integrating the module with Blesta. ### Installation Steps 1. **Upload module to Blesta installation** ```bash cp -r namecrane_mail /path/to/blesta/components/modules/ ``` 2. **Directory structure after installation:** ``` components/modules/namecrane_mail/ ├── apis/ │ └── namecrane_mail_api.php ├── config/ │ └── namecrane_mail.php ├── language/ │ └── en_us/ │ └── namecrane_mail.php ├── views/ │ └── default/ │ ├── add_row.pdt │ ├── edit_row.pdt │ ├── manage.pdt │ ├── dns_records.pdt │ ├── login_details.pdt │ ├── resource_usage.pdt │ ├── spamexperts_sso.pdt │ └── images/ │ └── logo.png ├── config.json └── namecrane_mail.php ``` 3. **Configure in Blesta Admin:** - Navigate to `Settings > Modules > Available`. - Install "Namecrane Mail". - Add Server with API key from Namecrane reseller portal. - Create packages specifying Namecrane Mail as the module. ``` -------------------------------- ### Initialize Namecrane Mail API Wrapper (PHP) Source: https://context7.com/namecrane/cranemail-blesta-module/llms.txt Initializes the Guzzle HTTP client and sets up the API key for communication with the Namecrane Mail backend. Handles GET and POST requests, JSON decoding, and error handling for API interactions. ```php api_key = $api_key; } public function execute($method, $action, $post = []) { $guzzle = new Client(); try { $return = $guzzle->request($method, 'https://namecrane.com/index.php?m=cranemail&action=api/' . $action, [ 'headers' => ['X-API-KEY' => $this->api_key], 'form_params' => ($method == 'POST' ? $post : []) ])->getBody(); $return = json_decode($return, true); if (json_last_error() !== JSON_ERROR_NONE) { return ['status' => false, 'message' => 'Invalid JSON response']; } return ['status' => $return['status'], 'message' => $return['message'], 'data' => $return]; } catch (\GuzzleHttp\Exception\RequestException $e) { return ['status' => false, 'message' => $e->getMessage()]; } } } ``` -------------------------------- ### SpamExperts SSO Login API (PHP) Source: https://context7.com/namecrane/cranemail-blesta-module/llms.txt Generates a single sign-on (SSO) URL for accessing the SpamExperts control panel. This API call requires an API key and a domain name, returning a URL that allows seamless login to SpamExperts. ```php 'example.com' ]; $result = $api->execute('POST', 'spamexperts/login', $post); // Expected response: // [ // 'status' => true, // 'data' => 'https://spamexperts.com/sso?token=abc123...' // ] ?> ``` -------------------------------- ### Blesta Package Configuration Options (PHP) Source: https://context7.com/namecrane/cranemail-blesta-module/llms.txt Defines customizable plan options for Blesta packages, allowing customers to override defaults at order time. This includes options like user limits, disk limits, and feature toggles for services. ```php 'quantity', // Max email accounts 'disklimit' => 'quantity', // Disk storage in GB 'useraliaslimit' => 'quantity', // Max email aliases 'domainaliaslimit' => 'quantity', // Max domain aliases 'spamexperts' => 'checkbox', // Enable SpamExperts 'archive_years' => 'dropdown', // Years: 0,1,2,3,4,5,6,7,8,9,10,15,20 'archive_direction' => 'dropdown', // Values: 'in', 'out', 'inout' 'filestorage' => 'checkbox', // Enable file storage 'office' => 'checkbox' // Enable office suite ]; // Email template variables available: // {package.disklimit}, {package.userlimit}, {package.useraliaslimit} // {service.namecrane_mail_domain}, {service.namecrane_mail_username}, {service.namecrane_mail_password} ?> ``` -------------------------------- ### Package Configuration Options Source: https://context7.com/namecrane/cranemail-blesta-module/llms.txt Blesta configuration options for customizable plans. These override package defaults when set by customers at order time. ```APIDOC ## Package Configuration Options ### Description Blesta configuration options for customizable plans. These override package defaults when set by customers at order time. ### Available Configuration Option Names and Types - **userlimit** (quantity) - Max email accounts - **disklimit** (quantity) - Disk storage in GB - **useraliaslimit** (quantity) - Max email aliases - **domainaliaslimit** (quantity) - Max domain aliases - **spamexperts** (checkbox) - Enable SpamExperts - **archive_years** (dropdown) - Years: 0,1,2,3,4,5,6,7,8,9,10,15,20 - **archive_direction** (dropdown) - Values: 'in', 'out', 'inout' - **filestorage** (checkbox) - Enable file storage - **office** (checkbox) - Enable office suite ### Email Template Variables - `{package.disklimit}` - `{package.userlimit}` - `{package.useraliaslimit}` - `{service.namecrane_mail_domain}` - `{service.namecrane_mail_username}` - `{service.namecrane_mail_password}` ``` -------------------------------- ### SpamExperts SSO Login API Source: https://context7.com/namecrane/cranemail-blesta-module/llms.txt Generates a single sign-on URL for accessing the SpamExperts control panel. This endpoint is called internally by the getSpamExpertsSSO() method. ```APIDOC ## POST spamexperts/login ### Description Generates a single sign-on URL for accessing the SpamExperts control panel. ### Method POST ### Endpoint /spamexperts/login ### Parameters #### Request Body - **domain** (string) - Required - The domain name for which to generate the SSO URL. ### Request Example ```json { "domain": "example.com" } ``` ### Response #### Success Response (200) - **status** (boolean) - Indicates if the operation was successful. - **data** (string) - The generated SpamExperts SSO URL. #### Response Example ```json { "status": true, "data": "https://spamexperts.com/sso?token=abc123..." } ``` ``` -------------------------------- ### Create Email Domain via API (PHP) Source: https://context7.com/namecrane/cranemail-blesta-module/llms.txt Creates a new email domain on the Namecrane Mail platform. It accepts various parameters for resource limits (disk, users, aliases) and feature enablement (SpamExperts, archiving, file storage, office suite). ```php 'example.com', 'disklimit' => 10, // GB of disk storage 'userlimit' => 25, // Max email accounts 'useraliaslimit' => 50, // Max email aliases 'domainaliaslimit' => 5, // Max domain aliases 'spamexperts' => true, // Enable SpamExperts filtering 'spamexperts_adminaccess' => 'primary', // 'primary' or 'all' 'archive_years' => 5, // Years to archive (0-20) 'archive_direction' => 'inout', // 'in', 'out', or 'inout' 'filestorage' => 1, // Enable file storage 'office' => 1 // Enable office suite ]; $result = $api->execute('POST', 'domain/create', $post); // Expected response: // [ // 'status' => true, // 'message' => 'Domain created successfully', // 'data' => [ // 'username' => 'admin@example.com', // 'password' => 'generated-password' // ] // ] ``` -------------------------------- ### Domain Create API Source: https://context7.com/namecrane/cranemail-blesta-module/llms.txt Creates a new email domain on the Namecrane Mail platform with specified resource limits and feature settings. ```APIDOC ## POST /domain/create ### Description Creates a new email domain on the Namecrane Mail platform with specified resource limits and feature settings. ### Method POST ### Endpoint /domain/create ### Parameters #### Query Parameters - **domain** (string) - Required - The domain name to create. - **disklimit** (integer) - Optional - GB of disk storage allocated to the domain. - **userlimit** (integer) - Optional - Maximum number of email accounts allowed. - **useraliaslimit** (integer) - Optional - Maximum number of email aliases allowed. - **domainaliaslimit** (integer) - Optional - Maximum number of domain aliases allowed. - **spamexperts** (boolean) - Optional - Enables SpamExperts filtering for the domain. - **spamexperts_adminaccess** (string) - Optional - SpamExperts admin access level ('primary' or 'all'). - **archive_years** (integer) - Optional - Number of years to archive emails (0-20). - **archive_direction** (string) - Optional - Direction of email archiving ('in', 'out', or 'inout'). - **filestorage** (integer) - Optional - Enables file storage for the domain (1 for enabled, 0 for disabled). - **office** (integer) - Optional - Enables the office suite for the domain (1 for enabled, 0 for disabled). ### Request Example ```json { "domain": "example.com", "disklimit": 10, "userlimit": 25, "useraliaslimit": 50, "domainaliaslimit": 5, "spamexperts": true, "spamexperts_adminaccess": "primary", "archive_years": 5, "archive_direction": "inout", "filestorage": 1, "office": 1 } ``` ### Response #### Success Response (200) - **status** (boolean) - Indicates if the operation was successful. - **message** (string) - A message describing the result of the operation. - **data** (object) - Contains additional data, such as username and password. - **username** (string) - The admin username for the created domain. - **password** (string) - The generated password for the admin user. #### Response Example ```json { "status": true, "message": "Domain created successfully", "data": { "username": "admin@example.com", "password": "generated-password" } } ``` ``` -------------------------------- ### Domain Info API Source: https://context7.com/namecrane/cranemail-blesta-module/llms.txt Retrieves current usage statistics, DNS records, and verification status for a domain. This endpoint is called internally by the _getDomainInfo() method. ```APIDOC ## POST domain/info ### Description Retrieves current usage statistics, DNS records, and verification status for a domain. ### Method POST ### Endpoint /domain/info ### Parameters #### Request Body - **domain** (string) - Required - The domain name to retrieve information for. ### Request Example ```json { "domain": "example.com" } ``` ### Response #### Success Response (200) - **status** (boolean) - Indicates if the operation was successful. - **data** (object) - Contains detailed information about the domain. - **data** (object) - Further nested data object. - **verified** (boolean) - Indicates if the domain is verified. - **dns** (object) - Required DNS records for the domain. - **dkim** (string) - DKIM record value. - **disk_used** (number) - Current disk space used in GB. - **disk_limit** (number) - The disk space limit in GB. - **users_count** (number) - The current number of email accounts. - **users_limit** (number) - The maximum number of email accounts allowed. - ... additional usage statistics #### Response Example ```json { "status": true, "data": { "data": { "verified": true, "dns": {}, "dkim": "...", "disk_used": 2.5, "disk_limit": 10, "users_count": 5, "users_limit": 25 } } } ``` ``` -------------------------------- ### Domain Info API (PHP) Source: https://context7.com/namecrane/cranemail-blesta-module/llms.txt Retrieves current usage statistics, DNS records, and verification status for a domain using the Namecrane Mail API. It requires an API key and the domain name, returning detailed information about the domain's status and resource utilization. ```php 'example.com' ]; $result = $api->execute('POST', 'domain/info', $post); // Expected response: // [ // 'status' => true, // 'data' => [ // 'data' => [ // 'verified' => true, // 'dns' => [...], // Required DNS records // 'dkim' => '...', // DKIM record value // 'disk_used' => 2.5, // 'disk_limit' => 10, // 'users_count' => 5, // 'users_limit' => 25, // // ... additional usage stats // ] // ] // ] ?> ``` -------------------------------- ### Domain Unsuspend API Source: https://context7.com/namecrane/cranemail-blesta-module/llms.txt Resumes services for a previously suspended email domain. ```APIDOC ## POST /domain/unsuspend ### Description Resumes services for a previously suspended email domain. ### Method POST ### Endpoint /domain/unsuspend ### Parameters #### Query Parameters - **domain** (string) - Required - The domain name to unsuspend. ### Request Example ```json { "domain": "example.com" } ``` ### Response #### Success Response (200) - **status** (boolean) - Indicates if the operation was successful. - **message** (string) - A message describing the result of the operation. #### Response Example ```json { "status": true, "message": "Domain unsuspended successfully" } ``` ``` -------------------------------- ### Domain Unsuspend API (PHP) Source: https://context7.com/namecrane/cranemail-blesta-module/llms.txt Reactivates a suspended email domain using the Namecrane Mail API. Requires an API key and the domain name as input. Returns a status and message indicating success or failure. ```php 'example.com' ]; $result = $api->execute('POST', 'domain/unsuspend', $post); // Expected response: // ['status' => true, 'message' => 'Domain unsuspended successfully'] ?> ``` -------------------------------- ### Modify Email Domain via API (PHP) Source: https://context7.com/namecrane/cranemail-blesta-module/llms.txt Updates resource limits and feature settings for an existing email domain. This allows for dynamic adjustment of storage, user accounts, aliases, and feature configurations. ```php 'example.com', 'disklimit' => 20, // Increased disk storage 'userlimit' => 50, // Increased email accounts 'useraliaslimit' => 100, 'domainaliaslimit' => 10, 'spamexperts' => true, 'spamexperts_adminaccess' => 'all', 'archive_years' => 10, 'archive_direction' => 'inout', 'filestorage' => 1, 'office' => 1 ]; $result = $api->execute('POST', 'domain/modify', $post); // Expected response: // ['status' => true, 'message' => 'Domain updated successfully'] ``` -------------------------------- ### Domain Suspend API Source: https://context7.com/namecrane/cranemail-blesta-module/llms.txt Suspends an email domain, typically due to non-payment or policy violation. ```APIDOC ## POST /domain/suspend ### Description Suspends an email domain, typically due to non-payment or policy violation. ### Method POST ### Endpoint /domain/suspend ### Parameters #### Query Parameters - **domain** (string) - Required - The domain name to suspend. ### Request Example ```json { "domain": "example.com" } ``` ### Response #### Success Response (200) - **status** (boolean) - Indicates if the operation was successful. - **message** (string) - A message describing the result of the operation. #### Response Example ```json { "status": true, "message": "Domain suspended successfully" } ``` ``` -------------------------------- ### Domain Modify API Source: https://context7.com/namecrane/cranemail-blesta-module/llms.txt Updates resource limits and feature settings for an existing email domain. ```APIDOC ## POST /domain/modify ### Description Updates resource limits and feature settings for an existing email domain. ### Method POST ### Endpoint /domain/modify ### Parameters #### Query Parameters - **domain** (string) - Required - The domain name to modify. - **disklimit** (integer) - Optional - Increased disk storage allocated to the domain. - **userlimit** (integer) - Optional - Increased maximum number of email accounts allowed. - **useraliaslimit** (integer) - Optional - Increased maximum number of email aliases allowed. - **domainaliaslimit** (integer) - Optional - Increased maximum number of domain aliases allowed. - **spamexperts** (boolean) - Optional - Enables or disables SpamExperts filtering for the domain. - **spamexperts_adminaccess** (string) - Optional - SpamExperts admin access level ('primary' or 'all'). - **archive_years** (integer) - Optional - Number of years to archive emails (0-20). - **archive_direction** (string) - Optional - Direction of email archiving ('in', 'out', or 'inout'). - **filestorage** (integer) - Optional - Enables or disables file storage for the domain (1 for enabled, 0 for disabled). - **office** (integer) - Optional - Enables or disables the office suite for the domain (1 for enabled, 0 for disabled). ### Request Example ```json { "domain": "example.com", "disklimit": 20, "userlimit": 50, "useraliaslimit": 100, "domainaliaslimit": 10, "spamexperts": true, "spamexperts_adminaccess": "all", "archive_years": 10, "archive_direction": "inout", "filestorage": 1, "office": 1 } ``` ### Response #### Success Response (200) - **status** (boolean) - Indicates if the operation was successful. - **message** (string) - A message describing the result of the operation. #### Response Example ```json { "status": true, "message": "Domain updated successfully" } ``` ``` -------------------------------- ### Domain Unsuspend API Source: https://context7.com/namecrane/cranemail-blesta-module/llms.txt Reactivates a previously suspended email domain. This endpoint is called internally by the unsuspendService() method. ```APIDOC ## POST domain/unsuspend ### Description Reactivates a previously suspended email domain. ### Method POST ### Endpoint /domain/unsuspend ### Parameters #### Request Body - **domain** (string) - Required - The domain name to unsuspend. ### Request Example ```json { "domain": "example.com" } ``` ### Response #### Success Response (200) - **status** (boolean) - Indicates if the operation was successful. - **message** (string) - A message confirming the domain was unsuspended. #### Response Example ```json { "status": true, "message": "Domain unsuspended successfully" } ``` ``` -------------------------------- ### Domain Delete API (PHP) Source: https://context7.com/namecrane/cranemail-blesta-module/llms.txt Permanently removes an email domain from the platform via the Namecrane Mail API. This action is typically triggered upon service cancellation. It requires an API key and the domain name, returning a status and message. ```php 'example.com' ]; $result = $api->execute('POST', 'domain/delete', $post); // Expected response: // ['status' => true, 'message' => 'Domain deleted successfully'] ?> ``` -------------------------------- ### Domain Delete API Source: https://context7.com/namecrane/cranemail-blesta-module/llms.txt Permanently deletes an email domain and all associated data from the Namecrane Mail platform. ```APIDOC ## POST /domain/delete ### Description Permanently deletes an email domain and all associated data from the Namecrane Mail platform. ### Method POST ### Endpoint /domain/delete ### Parameters #### Query Parameters - **domain** (string) - Required - The domain name to delete. ### Request Example ```json { "domain": "example.com" } ``` ### Response #### Success Response (200) - **status** (boolean) - Indicates if the operation was successful. - **message** (string) - A message describing the result of the operation. #### Response Example ```json { "status": true, "message": "Domain deleted successfully" } ``` ``` -------------------------------- ### Domain Delete API Source: https://context7.com/namecrane/cranemail-blesta-module/llms.txt Permanently removes an email domain from the platform upon service cancellation. This endpoint is called internally by the cancelService() method. ```APIDOC ## POST domain/delete ### Description Permanently removes an email domain from the platform upon service cancellation. ### Method POST ### Endpoint /domain/delete ### Parameters #### Request Body - **domain** (string) - Required - The domain name to delete. ### Request Example ```json { "domain": "example.com" } ``` ### Response #### Success Response (200) - **status** (boolean) - Indicates if the operation was successful. - **message** (string) - A message confirming the domain was deleted. #### Response Example ```json { "status": true, "message": "Domain deleted successfully" } ``` ``` -------------------------------- ### Suspend Email Domain via API (PHP) Source: https://context7.com/namecrane/cranemail-blesta-module/llms.txt Suspends an email domain on the Namecrane Mail platform. This action is typically used for non-payment or policy violations, effectively disabling the email service for the domain. ```php 'example.com' ]; $result = $api->execute('POST', 'domain/suspend', $post); // Expected response: // ['status' => true, 'message' => 'Domain suspended successfully'] ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.