lib/API.php
public function create_email($name, $subject, $html, $text=null) {
        $endpoint = "templates";

        $payload = array(
            "name" => $name,
            "subject" => $subject,
            "html" => $html
        );

        // set optional text
        if ($text) {
            $payload["text"] = $text;
        }

        if ($this->DEBUG) {
            $this->log_message(sprintf("creating email with name %s and subject %s\n", $name, $subject));
        }

        return $this->api_request($endpoint, self::HTTP_POST, $payload);
    }
public function create_email($name, $subject, $html, $text=null) {
        $endpoint = "templates";

        $payload = array(
            "name" => $name,
            "subject" => $subject,
            "html" => $html
        );

        // set optional text
        if ($text) {
            $payload["text"] = $text;
        }

        if ($this->DEBUG) {
            $this->log_message(sprintf("creating email with name %s and subject %s\n", $name, $subject));
        }

        return $this->api_request($endpoint, self::HTTP_POST, $payload);
    }
public function create_email ( $ name , $ subject , $ html , $ text = null ) { $ endpoint = "templates" ; $ payload = array ( "name" => $ name , "subject" => $ subject , "html" => $ html ) ; // set optional text if ( $ text ) { $ payload [ "text" ] = $ text ; } if ( $ this -> DEBUG ) { $ this -> log_message ( sprintf ( "creating email with name %s and subject %s\n" , $ name , $ subject ) ) ; } return $ this -> api_request ( $ endpoint , self :: HTTP_POST , $ payload ) ; }
Create an Email

@param string $name name of the email template
@param string $subject subject line for the email template
@param string $html HTML code for the email template
@param string $text Optional text version of the email template
@return array API response object
Create an Email