<?php

declare(strict_types=1);

/*
 * This file is part of the Ferienpass package.
 *
 * (c) Richard Henkenjohann <richard@ferienpass.online>
 *
 * For more information visit the project website <https://ferienpass.online>
 * or the documentation under <https://docs.ferienpass.online>.
 */

namespace Ferienpass\CoreBundle\Message;

use Ferienpass\CoreBundle\Entity\Payment;
use Symfony\Component\Uid\Uuid;

class SendMailing implements LoggableMessageInterface, GroupedMessageInterface
{
    public function __construct(private readonly string $email, private readonly string $subject, private readonly string $content, private readonly array $context, private readonly array $attachments = [], private readonly ?Uuid $groupId = null, private readonly ?Payment $payment = null, private readonly bool $personalized = true, private readonly ?string $bcc = null)
    {
    }

    public function getEmail(): string
    {
        return $this->email;
    }

    public function getSubject(): string
    {
        return $this->subject;
    }

    public function getContent(): string
    {
        return $this->content;
    }

    public function getContext(): array
    {
        return $this->context;
    }

    public function getAttachments(): array
    {
        return $this->attachments;
    }

    public function getPayment(): ?Payment
    {
        return $this->payment;
    }

    /**
     * Whether the recipient-specific {{ recipientEmail }} token is resolved to
     * this recipient's address. False for the sender's copy-to-self, which is
     * delivered as the neutral, non-personalized version instead.
     */
    public function isPersonalized(): bool
    {
        return $this->personalized;
    }

    /**
     * Blind-carbon-copy address added to this outgoing email, or null. Used to
     * copy the mailing's sender in on every recipient's (personalized) message.
     */
    public function getBcc(): ?string
    {
        return $this->bcc;
    }

    public function getRelated(): array
    {
        return [];
    }

    public function groupedBy(): ?string
    {
        return (string) $this->groupId;
    }
}
