Use the Edit Email Templates API to edit the email templates present on the server. These include content of the email, which will be sent to the admin/user when operations such as creation of VPS and deletion of VPS takes place. You can modify the templates to include company information in the emails. The API response will contain "done" as "1" after successful update of the email template.
HTTP Request
https://hostname:4085/index.php?act=editemailtemp&temp=TEMP
Parameters
Name | Method | Value | Description | Required |
---|---|---|---|---|
act | GET | editemailtemp | The action will edit the email template | Yes |
temp | POST | text | The template name that needs to be edited | Yes |
savetemplate | POST | 1/0 | If set then the new template will be set | Yes |
tempsub | POST | text | This will update the subject of the email template | Yes |
tempcontent | POST | text | This will update the content of the email template | Yes |
Sample Code
<?php
require_once('/usr/local/virtualizor/sdk/admin.php');
$key = 'your_api_key';
$pass = 'your_api_pass';
$ip = 'your_server_ip';
$admin = new Virtualizor_Admin_API($ip, $key, $pass);
$post = array();
$post['temp'] = 'unsuspend_users';
$post['savetemplate'] = 1;
$post['tempsub'] = 'Test editing with API';
$post['tempcontent'] = 'Email template test';
$output = $admin->editemailtemp($post);
print_r(json_encode($output));
?>
Output
{
"title": "Edit Email Template",
"done": "1",
"emailtemp": "null",
"timenow": "1480485898",
"time_taken": "0.104"
}