addAddress example

'name' => $key,
        ];

        return $this;
    }

    /** * @param array<string, mixed> $customParams */
    public function defaultBillingAddress(string $key, array $customParams = []): self
    {
        $this->addAddress($key$customParams);

        $defaultBillingAddress = $this->addresses;
        $defaultBillingAddress[$key]['id'] = $this->ids->get($key);
        $this->defaultBillingAddress = $defaultBillingAddress[$key];
        $this->defaultBillingAddressId = $this->ids->get($key);

        return $this;
    }

    /** * @param array<string, mixed> $customParams */
break;
                    }

                    $h = $headers->get($name);
                    if (!$h instanceof MailboxListHeader) {
                        throw new RuntimeException(sprintf('Unable to set header "%s".', $name));
                    }

                    Headers::checkHeaderClass($header);
                    foreach ($header->getAddresses() as $address) {
                        $h->addAddress($address);
                    }
            }
        }
    }

    private function renderMessage(Message $message): void
    {
        if (!$this->renderer) {
            return;
        }

        
                    $recipient_name = '';

                    if ( preg_match( '/(.*)<(.+)>/', $address$matches ) ) {
                        if ( count( $matches ) === 3 ) {
                            $recipient_name = $matches[1];
                            $address        = $matches[2];
                        }
                    }

                    switch ( $address_header ) {
                        case 'to':
                            $phpmailer->addAddress( $address$recipient_name );
                            break;
                        case 'cc':
                            $phpmailer->addCc( $address$recipient_name );
                            break;
                        case 'bcc':
                            $phpmailer->addBcc( $address$recipient_name );
                            break;
                        case 'reply_to':
                            $phpmailer->addReplyTo( $address$recipient_name );
                            break;
                    }
                }
/** * Sets a list of addresses to be shown in this Header. * * @param Address[] $addresses * * @throws RfcComplianceException */
    public function addAddresses(array $addresses): void
    {
        foreach ($addresses as $address) {
            $this->addAddress($address);
        }
    }

    /** * @throws RfcComplianceException */
    public function addAddress(Address $address): void
    {
        $this->addresses[] = $address;
    }

    
/** * Sets a list of addresses to be shown in this Header. * * @param Address[] $addresses * * @throws RfcComplianceException */
    public function addAddresses(array $addresses): void
    {
        foreach ($addresses as $address) {
            $this->addAddress($address);
        }
    }

    /** * @throws RfcComplianceException */
    public function addAddress(Address $address): void
    {
        $this->addresses[] = $address;
    }

    
'customerId' => $customerId,
                'email' => 'test@example.com',
                'salutationId' => $this->getValidSalutationId(),
                'firstName' => 'Max',
                'lastName' => 'Mustermann',
            ])
            ->add('stateId', $stateId)
            ->add('paymentMethodId', $paymentMethodId)
            ->add('currencyId', Defaults::CURRENCY)
            ->add('currencyFactor', 1.0)
            ->add('salesChannelId', TestDefaults::SALES_CHANNEL)
            ->addAddress('address', [
                'id' => $addressId,
                'salutationId' => $this->getValidSalutationId(),
                'firstName' => 'Max',
                'lastName' => 'Mustermann',
                'street' => 'Ebbinghoff 10',
                'zipcode' => '48624',
                'city' => 'Schöppingen',
                'countryId' => $this->getValidCountryId(),
            ])
            ->add('billingAddressId', $addressId)
            ->add('shippingAddressId', $addressId)
            
Home | Imprint | This part of the site doesn't use cookies.