Sailthru_Client::saveAlert PHP Method

saveAlert() public method

$when is only required when alert type is weekly or daily array( 'type' => array('shoes', 'shirts'), 'min' => array('price' => 3000), 'tags' => array('blue', 'red'), ) ); $response = $sailthruClient->saveAlert("[email protected]", 'realtime', 'default', null, $options); ?>
public saveAlert ( String $email, String $type, String $template, String $when = null, array $options = [] ) : array
$email String
$type String
$template String
$when String
$options array Associative array of additive nature match Exact-match a custom variable match[type]=shoes min Minimum-value variables min[price]=30000 max Maximum-value match max[price]=50000 tags Tag-match tags[]=blue
return array API result
    public function saveAlert($email, $type, $template, $when = null, $options = [])
    {
        $data = $options;
        $data['email'] = $email;
        $data['type'] = $type;
        $data['template'] = $template;
        if ($type == 'weekly' || $type == 'daily') {
            $data['when'] = $when;
        }
        return $this->apiPost('alert', $data);
    }