wip
This commit is contained in:
parent
70e4cca194
commit
84279cef75
BIN
assets/images/email/background.jpeg
Normal file
BIN
assets/images/email/background.jpeg
Normal file
Binary file not shown.
After Width: | Height: | Size: 60 KiB |
BIN
assets/images/email/header.jpeg
Normal file
BIN
assets/images/email/header.jpeg
Normal file
Binary file not shown.
After Width: | Height: | Size: 22 KiB |
@ -1,5 +1,7 @@
|
|||||||
twig:
|
twig:
|
||||||
file_name_pattern: '*.twig'
|
file_name_pattern: '*.twig'
|
||||||
|
paths:
|
||||||
|
'%kernel.project_dir%/assets/images/email': images
|
||||||
|
|
||||||
when@test:
|
when@test:
|
||||||
twig:
|
twig:
|
||||||
|
26
src/Controller/TestController.php
Normal file
26
src/Controller/TestController.php
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace App\Controller;
|
||||||
|
|
||||||
|
use chillerlan\QRCode\QRCode;
|
||||||
|
use Nucleos\DompdfBundle\Factory\DompdfFactory;
|
||||||
|
use Nucleos\DompdfBundle\Wrapper\DompdfWrapper;
|
||||||
|
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||||
|
use Symfony\Component\Filesystem\Filesystem;
|
||||||
|
use Symfony\Component\HttpFoundation\Response;
|
||||||
|
use Symfony\Component\Routing\Attribute\Route;
|
||||||
|
|
||||||
|
class TestController extends AbstractController
|
||||||
|
{
|
||||||
|
#[Route('/test')]
|
||||||
|
public function index(Filesystem $filesystem): Response
|
||||||
|
{
|
||||||
|
$dompdfWrapper = new DompdfWrapper(new DompdfFactory());
|
||||||
|
$content = $dompdfWrapper->getPdf($this->renderView('test.html.twig', ['qr' => (new QRCode())->render('https://www.google.com')]));
|
||||||
|
$filesystem->dumpFile('test.pdf', $content);
|
||||||
|
|
||||||
|
return $this->render('test.html.twig', ['qr' => (new QRCode())->render('https://www.google.com')]);
|
||||||
|
}
|
||||||
|
}
|
@ -10,6 +10,8 @@ use Symfony\Bridge\Twig\Mime\TemplatedEmail;
|
|||||||
use Symfony\Component\DependencyInjection\Attribute\Autowire;
|
use Symfony\Component\DependencyInjection\Attribute\Autowire;
|
||||||
use Symfony\Component\Mailer\MailerInterface;
|
use Symfony\Component\Mailer\MailerInterface;
|
||||||
use Symfony\Component\Mime\Address;
|
use Symfony\Component\Mime\Address;
|
||||||
|
use Symfony\Component\Mime\Part\DataPart;
|
||||||
|
use Symfony\Component\Mime\Part\File;
|
||||||
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
|
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
|
||||||
|
|
||||||
class TicketEmailService
|
class TicketEmailService
|
||||||
|
@ -1,30 +1,53 @@
|
|||||||
<!doctype html>
|
<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<title>Abiball Ticket</title>
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<title>Abiball - Freie Waldorfschule Bremen</title>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body style="margin: 0; padding: 0; font-family: Arial, sans-serif; background-color: #f6f6f6;">
|
||||||
Hallo {{ payment.customer.firstname }}
|
<table role="presentation" cellpadding="0" cellspacing="0" width="100%" style="background-color: #f6f6f6;">
|
||||||
<br>
|
<tr>
|
||||||
placeholder text
|
<td style="padding: 20px 0;">
|
||||||
<br>
|
<table role="presentation" cellpadding="0" cellspacing="0" width="300" style="margin: 0 auto; background-color: #ffffff; border-radius: 8px; overflow: hidden;">
|
||||||
<br>
|
<tr>
|
||||||
<hr>
|
<td style="background-color: #372064; padding: 10px 5px 5px; text-align: center;">
|
||||||
{% for ticket in payment.customer.tickets %}
|
<img src="{{ email.image('@images/header.jpeg') }}" alt="Abiball" style="width: 290px; height: auto;">
|
||||||
Ticket: {{ (ticket.type | ticket)['name'] }} ({{ (ticket.type | ticket)['price'] }}€)
|
</td>
|
||||||
<br>
|
</tr>
|
||||||
Essen: {{ ticket.foodType | food }}
|
|
||||||
<br>
|
|
||||||
{% if ticket.note %}
|
|
||||||
Anmerkung: {{ ticket.note }}
|
|
||||||
<br>
|
|
||||||
{% endif %}
|
|
||||||
<hr>
|
|
||||||
{% endfor %}
|
|
||||||
<br>
|
|
||||||
Gesamtpreis: {{ payment.total }}€
|
|
||||||
|
|
||||||
<img src="{{ qr }}" width="100">
|
<tr>
|
||||||
|
<td style="padding: 0;">
|
||||||
|
<img src="{{ email.image('@images/background.jpeg') }}" alt="Celebration" style="width: 100%; max-width: 300px; height: auto; display: block;">
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td style="padding: 40px;">
|
||||||
|
<h2 style="text-align: center; color: #333333; font-size: 24px; margin-bottom: 20px;">You're Invited!</h2>
|
||||||
|
<p style="text-align: center; color: #666666; font-size: 16px; line-height: 1.5; margin-bottom: 30px;">
|
||||||
|
Join us for an evening of celebration, dancing, and memories at the Freie Waldorfschule Bremen Graduation Ball
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<table role="presentation" cellpadding="0" cellspacing="0" width="100%" style="background-color: #f8f9fa; border-radius: 8px; margin-bottom: 30px;">
|
||||||
|
<tr>
|
||||||
|
<td style="padding: 25px;">
|
||||||
|
<h3 style="color: #333333; font-size: 18px; margin: 0 0 15px 0;">Event Details</h3>
|
||||||
|
<p style="color: #666666; margin: 5px 0;">Date: [Date]</p>
|
||||||
|
<p style="color: #666666; margin: 5px 0;">Time: [Time]</p>
|
||||||
|
<p style="color: #666666; margin: 5px 0;">Address: [Address]</p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<div style="text-align: center; margin-bottom: 30px;">
|
||||||
|
<img src="{{ qr }}" alt="QR Code" style="width: 75px; height: 75px;">
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
13
templates/test.html.twig
Normal file
13
templates/test.html.twig
Normal file
File diff suppressed because one or more lines are too long
Loading…
x
Reference in New Issue
Block a user