<?php

namespace email\templates;

use email\helpers\email_template;

class email_template_stripe_invoice
{
    use email_template;

    protected int $order_id;
    protected string $stripe_payment_link;
    protected string $name;

    public function __construct(int $order_id, string $stripe_payment_link, string $name)
    {
        $this->order_id = $order_id;
        $this->stripe_payment_link = $stripe_payment_link;
        $this->name = $name;
    }

    public function generate_text(): string
    {
        return "";
    }

    public function generate_html(): string
    {
        ob_start();
        # Start of the html
        ?>

        <!-- Email template -->
        <p>Kære <?= $this->name ?>,</p>
        <p>Tak for din bestilling hos Truck Wash. Vi har sendt dig en faktura på Stripe.
            Du kan betale fakturaen ved at klikke på linket nedenfor:</p>
        <p><a href="<?= $this->stripe_payment_link ?>">Betal faktura for ordre <?= $this->order_id ?></a></p>
        <!-- End of the email template -->

        <?php
        # End of the html
        return ob_get_clean();
    }
}