| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112 |
- <?php
- if (!defined("WHMCS")) {
- die("This file cannot be accessed directly");
- }
- function serviceAddon_CreateAccount(array $params) {
- $emailTemplates = serviceAddonGetEmailTemplates($params);
- if($params['Create_Mail'] > 0) {
- $result = localAPI('SendEmail', ['name' => $emailTemplates[$params['Create_Mail']]]);
- }
- logModuleCall(
- 'iServiceAddon',
- __FUNCTION__,
- $emailTemplates[$params['Create_Mail']],
- 'Debug',
- $result
- );
- return 'success';
- }
- function serviceAddon_SuspendAccount(array $params) {
- return 'success';
- }
- function serviceAddon_UnsuspendAccount(array $params) {
- return 'success';
- }
- function serviceAddon_TerminateAccount(array $params) {
- return 'success';
- }
- function serviceAddon_ChangePackage(array $params) {
- return 'success';
- }
- function serviceAddon_TestConnection(array $params) {
- return 'success';
- }
- function serviceAddon_UsageUpdate(array $params) {
- return 'success';
- }
- function serviceAddon_ConfigOptions(array $params) {
- $emailTemplates = serviceAddonGetEmailTemplates($params);
- $configOptions = array(
- "Create_Mail" => [
- "Type" => "dropdown", # Dropdown Choice of Options
- "Options" => $emailTemplates,
- "Description" => "E-Mail Template auswählen",
- "Default" => "option1"
- ],
- "Suspend_Mail" => [
- "Type" => "dropdown", # Dropdown Choice of Options
- "Options" => $emailTemplates,
- "Description" => "E-Mail Template auswählen",
- "Default" => "option1"
- ],
- "Unsuspend_Mail" => [
- "Type" => "dropdown", # Dropdown Choice of Options
- "Options" => $emailTemplates,
- "Description" => "E-Mail Template auswählen",
- "Default" => "option1"
- ],
- "ChangePackage_Mail" => [
- "Type" => "dropdown", # Dropdown Choice of Options
- "Options" => $emailTemplates,
- "Description" => "E-Mail Template auswählen",
- "Default" => "option1"
- ],
- "Terminate_Mail" => [
- "Type" => "dropdown", # Dropdown Choice of Options
- "Options" => $emailTemplates,
- "Description" => "E-Mail Template auswählen",
- "Default" => "option1"
- ],
- );
- return $configOptions;
- }
- function serviceAddon_MetaData() {
- }
- function serviceAddon_AdminCustomButtonArray($params) {
- }
- function serviceAddon_AdminServicesTabFields($params) {
- }
- function serviceAddon_ClientArea($params) {
- return array(
- 'tabOverviewReplacementTemplate' => 'templates/clientarea',
- 'vars' => array(
- 'test1' => 'hello',
- 'test2' => 'world',
- ),
- );
- };
- function serviceAddonGetEmailTemplates($params) {
- $response = localAPI('GetEmailTemplates');
- $emailTemplates = array('none');
- foreach ($response['emailtemplates']['emailtemplate'] as $emailTemplate) {
- if ($emailTemplate['custom'] == 1) {
- $emailTemplates[$emailTemplate['id']] = $emailTemplate['name'];
- }
- }
- return $emailTemplates;
- }
|