API Get email templates

From Virtualizor Wiki
Jump to: navigation, search

Get list of email templates

Example Code

<?php

    require_once('admin.php');

    $key =  'uketenhrhpunty5lhgwkcuxxxxxxxxxx';

    $pass = 'yrsofc3tg3tre7bjpfppspxxxxxxxxxx';

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

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

    $output = $admin->listemailtemp();
    print_r($output);
?>

Returns:

Array
(
    [title] => Email Templates
    [emailtemps] => Array
        (
            [addvs] => Array
                (
                    [title] => mail_addvs_sub
                    [body] => mail_addvs
                )

            [admin_addvs] => Array
                (
                    [title] => admin_mail_addvs_sub
                    [body] => admin_mail_addvs
                )

            [admin_addvs_err] => Array
                (
                    [title] => admin_mail_addvs_err_sub
                    [body] => admin_mail_addvs_err
                )

            [deletevs] => Array
                (
                    [title] => admin_mail_del_vs_sub
                    [body] => admin_mail_del_vs
                )

            [admin_del_vs_err] => Array
                (
                    [title] => admin_mail_del_vs_err_sub
                    [body] => admin_mail_del_vs_err
                )

            [admin_rebuild_vs] => Array
                (
                    [title] => admin_mail_rebuild_vs_sub
                    [body] => admin_mail_rebuild_vs
                )

            [admin_rebuild_vs_err] => Array
                (
                    [title] => admin_mail_rebuild_vs_err_sub
                    [body] => admin_mail_rebuild_vs_err
                )

            [createtemplate] => Array
                (
                    [title] => createtemplate_sub
                    [body] => createtemplate_vs
                )

            [createtemplate_err] => Array
                (
                    [title] => createtemplate_err_sub
                    [body] => createtemplate_vs_err
                )

            [reset_pass] => Array
                (
                    [title] => mail_sub
                    [body] => mail_body
                )

        )

    [timenow] => 1403071321
    [time_taken] => 0.016
)