Sailthru_Client::receiveHardBouncePost PHP Method

receiveHardBouncePost() public method

Hard bounce postbacks
public receiveHardBouncePost ( ) : boolean
return boolean
    public function receiveHardBouncePost()
    {
        $params = $_POST;
        foreach (['action', 'email', 'sig'] as $k) {
            if (!isset($params[$k])) {
                return false;
            }
        }
        if ($params['action'] != 'hardbounce') {
            return false;
        }
        $sig = $params['sig'];
        unset($params['sig']);
        if ($sig != Sailthru_Util::getSignatureHash($params, $this->secret)) {
            return false;
        }
        if (isset($params['send_id'])) {
            $send_id = $params['send_id'];
            $send = $this->getSend($send_id);
            if (!isset($send['email'])) {
                return false;
            }
        } else {
            if (isset($params['blast_id'])) {
                $blast_id = $params['blast_id'];
                $blast = $this->getBlast($blast_id);
                if (isset($blast['error'])) {
                    return false;
                }
            }
        }
        return true;
    }