@param SimpleXMLElement $xmlRecipient

@return DTO\Recipient
489496
public static function createFromXml(SimpleXMLElement $xmlRecipient)
    {
        $recipient = new DTO\Recipient();

        if (isset($xmlRecipient->Nm)) {
            $recipient->setName((string) $xmlRecipient->Nm);
        }
        if (isset($xmlRecipient->PstlAdr)) {
            $recipient->setAddress(Address::createFromXml($xmlRecipient->PstlAdr));
        }
        if (isset($xmlRecipient->CtryOfRes)) {
            $recipient->setCountryOfResidence((string) $xmlRecipient->CtryOfRes);
        }
        if (isset($xmlRecipient->CtctDtls)) {
            $recipient->setContactDetails(ContactDetails::createFromXml($xmlRecipient->CtctDtls));
        }
        if (isset($xmlRecipient->Id)) {
            if (isset($xmlRecipient->Id->OrgId)) {
                $recipient->setIdentification(OrganisationIdentification::createFromXml($xmlRecipient->Id->OrgId));
            }
        }

        return $recipient;
    }
1097294
public function sendOrderMail(
        $recipient,
        $templatePath,
        $data = array(),
        ApiOrderInterface $apiOrder = null,
        $blindCopyRecipients = array()
    ) {
        $tmplData = array_merge(
            $data,
            array(
                'footerTxt' => $this->templateFooterTxtPath,
                'footerHtml' => $this->templateFooterHtmlPath,
            )
        );

        $template = $this->twig->loadTemplate($templatePath);
        $subject = $template->renderBlock('subject', $tmplData);

        $emailBodyText = $template->renderBlock('body_text', $tmplData);
        $emailBodyHtml = $template->renderBlock('body_html', $tmplData);

        /** @var \Swift_Message $message */
        $message = \Swift_Message::newInstance()
            ->setSubject($subject)
            ->setFrom($this->emailFrom)
            ->setTo($recipient)
            ->setBody($emailBodyText, 'text/plain')
            ->addPart($emailBodyHtml, 'text/html');
        
        // add blind copy recipients
        foreach ($blindCopyRecipients as $bcc) {
            $message->addBcc($bcc);
        }

        // add pdf if order is supplied
        if ($apiOrder) {
            $pdf = $this->pdfManager->createOrderConfirmation($apiOrder);
            $pdfFileName = $this->pdfManager->getPdfName($apiOrder);
            // now send mail
            $attachment = \Swift_Attachment::newInstance()
                ->setFilename($pdfFileName)
                ->setContentType('application/pdf')
                ->setBody($pdf);
            $message->attach($attachment);
        }

        $failedRecipients = array();
        $this->mailer->send($message, $failedRecipients);

        if (count($failedRecipients) > 0) {
            $this->writeLog('Could not send mail to the following recipients: ' . join(', ', $failedRecipients));

            return false;
        }

        return true;
    }
578344
public function setWithRecipient($withRecipient = true)
    {
        $this->isBool($withRecipient, 'withRecipient');
        $this->withRecipient = $withRecipient;

        if ($withRecipient === false) {
            $this->recipientLine1 = '';
            $this->recipientLine2 = '';
            $this->recipientLine3 = '';
            $this->recipientLine4 = '';
        }

        return $this;
    }
1260247
public function getRecipientSpecificNewsletterSubject(array $generalContentItems, array $recipientContentItems, array $params, RecipientInterface $recipient, $locale)
    {
        return parent::getRecipientSpecificNewsletterSubject($generalContentItems, $recipientContentItems, $params, $recipient, $locale);
    }
1192335
public function setNotificationRecipient($v)
    {
        if ($v !== null) {
            $v = (string) $v;
        }

        if ($this->notification_recipient !== $v) {
            $this->notification_recipient = $v;
            $this->modifiedColumns[] = RemoteAppPeer::NOTIFICATION_RECIPIENT;
        }


        return $this;
    }
853336
public function inject(Xml $element)
	{
		$element->setAncestor($this->getAncestor());
		$element->setRoot($this->getRoot());
		$element->parent = $this;
		return $this->appendChild($element);
	}
659228
public function createFromXml(XmlElement $xml): TrackInterface
    {
        $uri = (string) $xml->getTag("res");
        $class = $this->guessTrackClass($uri);

        return $class::createFromXml($xml, $this->controller);
    }
666764
public function createRecipient()
    {
        $result = count( $this->recipients );
        $this->recipients[$result] = new ezcMailHeadersHolder();
        return $result;
    }
906470
public static function parseResponseRuleXml(SimpleXMLElement $xml){
        $returnValue = self::parseElementXml($xml);
        foreach($xml->children() as $child){
            $returnValue['expression'] = self::parseExpressionXml($child);
            break;
        }
        return $returnValue;
    }
884011
public function _hydrateGiftCardData(HpsGiftCard $giftCard, DOMDocument $xml, $elementName = 'CardData')
    {
        $giftCardData = $xml->createElement('hps:'.$elementName);
        if ($giftCard->number != null) {
            $giftCardData->appendChild($xml->createElement('hps:CardNbr', $giftCard->number));
        } else if ($giftCard->trackData != null) {
            $giftCardData->appendChild($xml->createElement('hps:TrackData', $giftCard->trackData));
        } else if ($giftCard->alias != null) {
            $giftCardData->appendChild($xml->createElement('hps:Alias', $giftCard->alias));
        } else if ($giftCard->tokenValue != null) {
            $giftCardData->appendChild($xml->createElement('hps:TokenValue', $giftCard->tokenValue));
        }

        if ($giftCard->encryptionData != null) {
            $giftCardData->appendChild($this->_hydrateEncryptionData($giftCard->encryptionData, $xml));
        }

        if ($giftCard->pin != null) {
            $giftCardData->appendChild($xml->createElement('hps:PIN', $giftCard->pin));
        }

        return $giftCardData;
    }
1186469
public function getRecipient()
    {
        if (!is_string($this->otherGuidAttribute) || empty($this->otherGuidAttribute)) {
            throw new \yii\base\InvalidConfigException('Recipient GUID Attribute Not Specified.');
        }
        $hostClass = $this->hostClass;
        $model = $hostClass::buildNoInitModel();
        return $this->hasOne($hostClass::className(), [$model->guidAttribute => 'otherAttribute']);
    }
218657
public function sendMail(
        $recipient,
        $templatePath,
        $data = array(),
        $blindCopyRecipients = array()
    ) {
        $tmplData = array_merge(
            $data,
            array(
                'footerTxt' => $this->templateFooterTxtPath,
                'footerHtml' => $this->templateFooterHtmlPath,
            )
        );

        // Load template from twig.
        $template = $this->twig->loadTemplate($templatePath);

        // Merge twig globals so that they also are available in renderBlock.
        $tmplData = $this->twig->mergeGlobals($tmplData);

        // Get subject from block.
        $subject = $template->renderBlock('subject', $tmplData);

        $emailBodyText = $template->renderBlock('body_text', $tmplData);
        $emailBodyHtml = $template->renderBlock('body_html', $tmplData);

        /** @var \Swift_Message $message */
        $message = \Swift_Message::newInstance()
            ->setSubject($subject)
            ->setFrom($this->emailFrom)
            ->setTo($recipient)
            ->setBody($emailBodyText, 'text/plain')
            ->addPart($emailBodyHtml, 'text/html');
        
        // add blind copy recipients
        foreach ($blindCopyRecipients as $bcc) {
            $message->addBcc($bcc);
        }

        $failedRecipients = array();
        $this->mailer->send($message, $failedRecipients);

        if (count($failedRecipients) > 0) {
            $this->writeLog('Could not send mail to the following recipients: ' . join(', ', $failedRecipients));

            return false;
        }

        return true;
    }
1153547
public static function createFromXml(SimpleXMLElement $xmlAddress)
    {
        $address = new DTO\Address();

        if (isset($xmlAddress->Ctry)) {
            $address = $address->setCountry((string) $xmlAddress->Ctry);
        }
        if (isset($xmlAddress->CtrySubDvsn)) {
            $address = $address->setCountrySubDivision((string) $xmlAddress->CtrySubDvsn);
        }
        if (isset($xmlAddress->Dept)) {
            $address = $address->setDepartment((string) $xmlAddress->Dept);
        }
        if (isset($xmlAddress->SubDept)) {
            $address = $address->setSubDepartment((string) $xmlAddress->SubDept);
        }
        if (isset($xmlAddress->StrtNm)) {
            $address = $address->setStreetName((string) $xmlAddress->StrtNm);
        }
        if (isset($xmlAddress->BldgNb)) {
            $address = $address->setBuildingNumber((string) $xmlAddress->BldgNb);
        }
        if (isset($xmlAddress->PstCd)) {
            $address = $address->setPostCode((string) $xmlAddress->PstCd);
        }
        if (isset($xmlAddress->TwnNm)) {
            $address = $address->setTownName((string) $xmlAddress->TwnNm);
        }
        if (isset($xmlAddress->AdrLine)) {
            foreach ($xmlAddress->AdrLine as $line) {
                $address = $address->addAddressLine((string)$line);
            }
        }

        return $address;
    }
38350
public function writeInnerXml(\XMLWriter $xmlWriter)
    {
        Validate::notNull($xmlWriter, 'xmlWriter');
        $xmlWriter->writeElementNS(
            'atom',
            'name',
            Resources::ATOM_NAMESPACE,
            $this->name
        );

        $this->writeOptionalElementNS(
            $xmlWriter,
            'atom',
            'uri',
            Resources::ATOM_NAMESPACE,
            $this->uri
        );

        $this->writeOptionalElementNS(
            $xmlWriter,
            'atom',
            'email',
            Resources::ATOM_NAMESPACE,
            $this->email
        );
    }
354062
public function setRecipientType($recipientType)
    {
        $allowed_values = array('alliance', 'character', 'corporation', 'mailing_list');
        if ((!in_array($recipientType, $allowed_values))) {
            throw new \InvalidArgumentException("Invalid value for 'recipientType', must be one of 'alliance', 'character', 'corporation', 'mailing_list'");
        }
        $this->container['recipientType'] = $recipientType;

        return $this;
    }
74028
public static function parseResponseIfXml(SimpleXMLElement $xml){
        $returnValue = self::parseElementXml($xml);
        $i = 0;
        $expression = null;
        $responseRules = array();
        foreach($xml->children() as $child){
            if($i){
                $name = $child->getName();
                $methodName = 'parse'.ucfirst($name).'Xml';
                if(method_exists(__CLASS__, $methodName)){
                    $responseRules[] = self::$methodName($child);
                } else{
                    $responseRules[] = self::parseResponseRuleXml($child);
                }
            }else{
                //the first child is the expression
                $expression = self::parseExpressionXml($child);
            }
            $i++;
        }
        $returnValue['expression'] = $expression;
        $returnValue['responseRules'] = $responseRules;
        return $returnValue;
    }
1091987
public function addRecipientConditions(QueryBuilder $builder, IdentifierRecipientInterface $recipient)
    {
        $alias = $builder->getRootAliases()[0];
        $builder
            ->where(
                $builder->expr()->andX(
                    $builder->expr()->eq($alias . '.recipientClass', ':class'),
                    $builder->expr()->eq($alias . '.recipientId', ':id')
                )
            )
            ->setParameter('class', ClassUtils::getClass($recipient))
            ->setParameter('id', $recipient->getId())
        ;

        return $builder;
    }