API Edit email template

From Virtualizor Wiki
Jump to: navigation, search
NOTE
This is OLD API Documentation. Click on the following link for New API Documentation
Admin API

Edit Email Template

Parameters Description
tempsub Subject of Email
tempcontent Body of the Email
template_name Email template name

Example Code

<?php

    require_once('admin.php');

    $key =  'uketenhrhpunty5lhgwkcuxxxxxxxxxx';

    $pass = 'yrsofc3tg3tre7bjpfppspxxxxxxxxxx';

    $ip = 'xxx.xxx.xxx.xxx';

    $admin = new Virtualizor_Admin_API($ip, $key, $pass);

    $post = array();
    $post['tempsub'] = 'VPS created';
    $post['tempcontent'] = 'Hi,
    apites222
    Your VPS has been created.
    The Login details are as follows :
    Username : {{username}}
    Password : {{password}}
    URL : https://{{host}}:4083
	  http://{{host}}:4082

    Your VPS details are :
    VPSID : {{vpsid}}
    Username : root
    Root Password : {{root_pass}}
    IP(s) : {{ips}}
    {{macdetails}}

    {{vncdetails}}
	  
    Regards,
    {{sn}}';
    $post['template_name'] = 'addvs';
    $output = $admin->editemailtemp($post);
    print_r($output);
?>

Returns:

Array
(
    [title] => Edit Email Template
    [done] => 1
    [emailtemp] => 
    [timenow] => 1403072914
    [time_taken] => 0.016
)