/** * Use customer key ($custKey) as the triggered send key definition. * * @param type $custKey * @param type $options */ public function useKey($custKey, $options = array()) { $tsd = new EtTriggeredSendDefinition(); $tsd->setCustomerKey($custKey); if (!empty($options)) { foreach ($options as $key => $value) { $tsd->set($key, $value); } } $this->TriggeredSendDefinition = new \SoapVar($tsd, SOAP_ENC_OBJECT, "TriggeredSendDefinition", EtClient::SOAPWSDL); }
/** * * @param string $triggeredSendKey * @param array $options * @return EtTriggeredSend */ public function buildTriggeredSend($triggeredSendKey, $options = array()) { $tsd = new EtTriggeredSendDefinition(); $tsd->setCustomerKey($triggeredSendKey); if (!empty($options)) { foreach ($options as $key => $value) { $tsd->set($key, $value); } } $ts = new EtTriggeredSend($this); $ts->setTriggeredSendDefinition(new \SoapVar($tsd, SOAP_ENC_OBJECT, "TriggeredSendDefinition", self::SOAPWSDL)); // return the triggeredSend to allow you to add subscribers or whatever you need to do return $ts; }