Creates and sends email with price alarm information.

@param string $emailAddress Email address
@param string $productID    Product id
@param string $priceAlarmId Price alarm id
@param string $bidPrice     Bid price
506103
public function sendeMail($emailAddress, $productID, $priceAlarmId, $bidPrice)
    {
        $alarm = oxNew(\OxidEsales\Eshop\Application\Model\PriceAlarm::class);
        $alarm->load($priceAlarmId);

        $language = \OxidEsales\Eshop\Core\Registry::getLang();
        $languageId = (int) $alarm->oxpricealarm__oxlang->value;

        $oldLanguageId = $language->getTplLanguage();
        $language->setTplLanguage($languageId);

        $email = oxNew(\OxidEsales\Eshop\Core\Email::class);
        $success = (int) $email->sendPricealarmToCustomer($emailAddress, $alarm);

        $language->setTplLanguage($oldLanguageId);

        if ($success) {
            $alarm->oxpricealarm__oxsended = new \OxidEsales\Eshop\Core\Field(date("Y-m-d H:i:s"));
            $alarm->save();
        }
    }
660517
private function setEmailAddress(?string $emailAddress): self
    {
        $this->updatePropertyValue(
            EmailAddressFieldInterface::PROP_EMAIL_ADDRESS,
            $emailAddress
        );

        return $this;
    }
337987
private function handleQuote(array &$emailAddress)
    {
        if ($emailAddress['quote_temp']) {
            $emailAddress['name_parsed'] .= $emailAddress['quote_temp'];
            $emailAddress['name_quoted'] = true;
            $emailAddress['quote_temp'] = '';
        } elseif ($emailAddress['address_temp']) {
            $emailAddress['name_parsed'] .= $emailAddress['address_temp'];
            $emailAddress['name_quoted'] = $emailAddress['address_temp_quoted'];
            $emailAddress['address_temp_quoted'] = false;
            $emailAddress['address_temp'] = '';
            if ($emailAddress['address_temp_period'] > 0) {
                $emailAddress['invalid'] = true;
                $emailAddress['invalid_reason'] = 'Periods within the name of an email address must appear in quotes, such as "John Q. Public" <john@qpublic.com>';
            }
        }
    }
667164
public function create($productId, ProductImage &$productImage)
    {
        $data = $productImage->exportData();
        $endpoint = '/admin/products/'.$productId.'/images.json';
        $response = $this->request(
            $endpoint, 'POST', array(
            'image' => $data
            )
        );
        $productImage->setData($response['image']);
    }
914030
protected function createVendor(
        $email,
        $walletId,
        $walletSpaceId,
        $identified,
        $miraklId,
        $vatNumber,
        $callbackSalt,
        $miraklData
    ) {
        $this->logger->debug(
            "The wallet number is $walletId",
            array('miraklId' => $miraklId, "action" => "Wallet creation")
        );
        $vendor = $this->vendorManager->create(
            $email,
            $miraklId,
            $walletId,
            $walletSpaceId,
            $identified,
            $vatNumber,
            $callbackSalt,
            $miraklData
        );

        $vendor->setEmail($email);
        $vendor->setHiPayId($walletId);
        $vendor->setMiraklId($miraklId);
        $vendor->setHiPayUserSpaceId($walletSpaceId);
        $vendor->setHiPayIdentified($identified);
        $vendor->setVatNumber($vatNumber);
        $vendor->setCallbackSalt($callbackSalt);
        $vendor->setEnabled(true);
        $vendor->setCountry($miraklData["contact_informations"]["country"]);
        $vendor->setPaymentBlocked($miraklData["payment_details"]["payment_blocked"]);

        $this->logger->info('[OK] Wallet recorded', array('miraklId' => $miraklId, "action" => "Wallet creation"));

        return $vendor;
    }
463375
public function setLogMailRecipient(string $mailRecipient, string $mailAddresser) {
		$this->logMailRecipient = $mailRecipient;
		$this->logMailAddresser = $mailAddresser;
	}
1254494
public function deleteProduct($product_id)
    {
        if (isset($this->_products[$product_id]["trial"]))
        {
            $this->deleteTrial($product_id);
        }
        if (isset($this->_products[$product_id]["subscription"]))
        {
            $this->deleteSubscription($product_id);
        }
        if (isset($this->_products[$product_id]["payment_plan"]))
        {
            $this->deletePaymentPlan($product_id);
        }
        unset($this->_products[$product_id]);

        return $this->_products;
    }
169641
public function replyTo($emailAddress)
    {
        try {
            $this->mailer->AddReplyTo($emailAddress);
        } catch (phpmailerException $e) {
            throw new EmailException($e->getMessage(), $e->getCode());
        }

        return $this;
    }
763483
public function loadPriceData($storeId, $productIds)
    {
        $websiteId = $this->getStore($storeId)->getWebsiteId();

        $baseSelects = [];
        foreach ($this->getPriceIndexDimensionsTables($websiteId) as $dimensionsTable) {
            $baseSelects[] = $this->getLoadPriceDataSelect($dimensionsTable, $websiteId, $productIds);
        }
        $select = $this->getConnection()->select()->union($baseSelects);

        return $this->getConnection()->fetchAll($select);
    }
469170
private function recordProductViewByLoggedUser($productId, $viewedProduct = null) {
        if (!empty($productId)) {
            if ($this->module->log['maxProducts'] == 0) {

                if (empty($viewedProduct)) {
                    $this->recordProductView($productId);
                }
            }
        }
    }
223300
public function findOneByProductIdAndWebsite($productId, $websiteId)
    {

        // prepare the params
        $params = array(
            MemberNames::PRODUCT_ID => $productId,
            MemberNames::WEBSITE_ID => $websiteId
        );

        // load and return the product with the passed product/website ID
        $this->productWebsiteStmt->execute($params);
        return $this->productWebsiteStmt->fetch(\PDO::FETCH_ASSOC);
    }
926548
public function send($mailAddress, $username, $subject, $body)
    {
        $subject = $this->translator->trans($subject);
        $body = $this->translator->trans(
            $body,
            ['%username%' => $username]
        );

        $message = $this->messageFactory->create();
        $message
            ->setSubject($subject)
            ->setFrom($this->mailerAddress)
            ->setTo($mailAddress)
            ->setBody($body);

        return $this->mailer->send($message);
    }
532347
protected function processUpdateAction(
        array $data,
        ProductSaleElements $pse,
        Product $product
    ) {
        list($price, $salePrice) = $this->extractPrices($data);

        $event = new ProductSaleElementUpdateEvent($product, $pse->getId());

        $event
            ->setWeight($data["weight"])
            ->setTaxRuleId($data["tax_rule_id"])
            ->setEanCode($data["ean_code"])
            ->setOnsale($data["onsale"])
            ->setReference($data["reference"])
            ->setIsdefault($data["isdefault"])
            ->setIsnew($data["isnew"])
            ->setCurrencyId($data["currency_id"])
            ->setPrice($price)
            ->setSalePrice($salePrice)
            ->setQuantity($data["quantity"])
            ->setFromDefaultCurrency($data["use_exchange_rate"])
        ;

        $this->dispatch(TheliaEvents::PRODUCT_UPDATE_PRODUCT_SALE_ELEMENT, $event);
    }
898630
public function setToAddress($emailAddress)
    {
        if (filter_var($emailAddress, FILTER_VALIDATE_EMAIL) !== $emailAddress) {
            throw new \InvalidArgumentException('Invalid email address: '.$emailAddress);
        }
        $this->toAddress = $emailAddress;
    }
1234487
public function getPvByProductAndStock($productId, $stockId)
    {
        /* aliases and tables */
        $asStockItem = 'csi';
        $asPv = 'ppsi';
        $tblStockItem = [$asStockItem => $this->resource->getTableName(Cfg::ENTITY_MAGE_CATALOGINVENTORY_STOCK_ITEM)];
        $tblPv = [$asPv => $this->resource->getTableName(Entity::ENTITY_NAME)];
        /* SELECT FROM cataloginventory_stock_item */
        $query = $this->conn->select();
        $cols = [];
        $query->from($tblStockItem, $cols);
        /* LEFT JOIN prxgt_pv_stock_item */
        $on = $asPv . '.' . Entity::A_ITEM_REF . '=' . $asStockItem . '.' . Cfg::E_CATINV_STOCK_ITEM_A_ITEM_ID;
        $cols = [Entity::A_PV];
        $query->joinLeft($tblPv, $on, $cols);
        /* WHERE */
        $where = $asStockItem . '.' . Cfg::E_CATINV_STOCK_ITEM_A_PROD_ID . '=' . (int)$productId;
        $where .= ' AND ' . $asStockItem . '.' . Cfg::E_CATINV_STOCK_ITEM_A_STOCK_ID . '=' . (int)$stockId;
        $query->where($where);
        /* fetch data */
        $result = $this->conn->fetchOne($query);
        return $result;
    }
1341891
function updatePriceInfo( $productCollectionID, &$basketInfo )
    {
        $shippingInfo = eZShippingManager::getShippingInfo( $productCollectionID );
        $additionalShippingValues = eZShippingManager::vatPriceInfo( $shippingInfo );
        $returnValue = false;
        foreach ( $additionalShippingValues['shipping_vat_list'] as $vatValue => $additionalShippingValueArray )
        {
            $shippingExVAT = $additionalShippingValueArray['shipping_ex_vat'];
            $shippingIncVAT = $additionalShippingValueArray['shipping_inc_vat'];
            $shippingVat = $additionalShippingValueArray['shipping_vat'];

            if ( !isset( $basketInfo['price_info'][$vatValue]['total_price_ex_vat'] ) )
            {
                $basketInfo['price_info'][$vatValue]['total_price_ex_vat'] = $shippingExVAT;
                $basketInfo['price_info'][$vatValue]['total_price_inc_vat'] = $shippingIncVAT;
                $basketInfo['price_info'][$vatValue]['total_price_vat'] = $shippingVat;

                $basketInfo['total_price_info']['total_price_ex_vat'] = $shippingExVAT;
                $basketInfo['total_price_info']['total_price_inc_vat'] = $shippingIncVAT;
                $basketInfo['total_price_info']['total_price_vat'] = $shippingVat;
            }
            else
            {
                $basketInfo['price_info'][$vatValue]['total_price_ex_vat'] += $shippingExVAT;
                $basketInfo['price_info'][$vatValue]['total_price_inc_vat'] += $shippingIncVAT;
                $basketInfo['price_info'][$vatValue]['total_price_vat'] += $shippingVat;

                $basketInfo['total_price_info']['total_price_ex_vat'] += $shippingExVAT;
                $basketInfo['total_price_info']['total_price_inc_vat'] += $shippingIncVAT;
                $basketInfo['total_price_info']['total_price_vat'] += $shippingVat;
            }

            if ( !isset( $basketInfo['additional_info']['shipping_items'][$vatValue]['total_price_ex_vat'] ) )
            {
                $basketInfo['additional_info']['shipping_items'][$vatValue]['total_price_ex_vat'] = $shippingExVAT;
                $basketInfo['additional_info']['shipping_items'][$vatValue]['total_price_inc_vat'] = $shippingIncVAT;
                $basketInfo['additional_info']['shipping_items'][$vatValue]['total_price_vat'] = ( $shippingIncVAT - $shippingExVAT );
            }
            else
            {
                $basketInfo['additional_info']['shipping_items'][$vatValue]['total_price_ex_vat'] += $shippingExVAT;
                $basketInfo['additional_info']['shipping_items'][$vatValue]['total_price_inc_vat'] += $shippingIncVAT;
                $basketInfo['additional_info']['shipping_items'][$vatValue]['total_price_vat'] += ( $shippingIncVAT - $shippingExVAT );
            }

            if ( !isset( $basketInfo['additional_info']['shipping_total']['total_price_ex_vat'] ) )
            {
                $basketInfo['additional_info']['shipping_total']['total_price_ex_vat'] = $shippingExVAT;
                $basketInfo['additional_info']['shipping_total']['total_price_inc_vat'] = $shippingIncVAT;
                $basketInfo['additional_info']['shipping_total']['total_price_vat'] = ( $shippingIncVAT - $shippingExVAT );
            }
            else
            {
                $basketInfo['additional_info']['shipping_total']['total_price_ex_vat'] += $shippingExVAT;
                $basketInfo['additional_info']['shipping_total']['total_price_inc_vat'] += $shippingIncVAT;
                $basketInfo['additional_info']['shipping_total']['total_price_vat'] += ( $shippingIncVAT - $shippingExVAT );
            }
        }

        if ( count( $additionalShippingValues['shipping_vat_list'] ) > 0 )
        {
            $returnValue = true;
        }

        return $returnValue;
    }
1329670
public function updateEmailContent($emailId, $args = array(), $returnRaw = false)
    {
        $args['id'] = $emailId;

        return $this->getResult('updateEmailContent', $args, false, $returnRaw);
    }