Skip to content

Commit

Permalink
demo
Browse files Browse the repository at this point in the history
  • Loading branch information
lennyrouanet committed Mar 29, 2024
1 parent b9162c3 commit 49e259f
Show file tree
Hide file tree
Showing 4 changed files with 101 additions and 0 deletions.
35 changes: 35 additions & 0 deletions demo/build-email-cta.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?php

include '../vendor/autoload.php';

use Phant\EmailSender\Service\EmailBuilder;

$emailBuilder = new EmailBuilder();

$bodyHtml = nl2br(
'Hello,
Would you like to find out more about our work?
Visit our Github page:'
);
$bodyHtml .= $emailBuilder->buildCta(
'https://github.com/PhantPHP',
'Github'
);
$bodyHtml .= nl2br(
'Thank you for your trust,
The Phant team'
);

$html = $emailBuilder->build(
$bodyHtml,
'image/logo.png',
'image/logo.png',
nl2br(
'Made with passion, in France
© Phant ' . date('Y')
)
);

echo $html;
29 changes: 29 additions & 0 deletions demo/build-email-information.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?php

include '../vendor/autoload.php';

use Phant\EmailSender\Service\EmailBuilder;

$emailBuilder = new EmailBuilder();

$bodyHtml = nl2br(
'<b>Lorem ipsum dolor sit amet</b>
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.'
);

$html = $emailBuilder->build(
$bodyHtml,
'image/logo.png',
'image/logo.png',
nl2br(
'Made with passion, in France
© Phant ' . date('Y')
)
);

echo $html;
37 changes: 37 additions & 0 deletions demo/build-email-otp.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?php

include '../vendor/autoload.php';

use Phant\EmailSender\Service\EmailBuilder;

$emailBuilder = new EmailBuilder();

$bodyHtml = nl2br(
'Hello,
Here is the verification code you requested :'
);
$bodyHtml .= $emailBuilder->buildOtp('123456');
$bodyHtml .= nl2br(
'This single-use code will expire in 15 minutes.
Thank you for your trust,
The Phant team'
);
$bodyHtml .= $emailBuilder->buildMeta([
'IP address' => $_SERVER['REMOTE_ADDR'],
'Browser' => $_SERVER['HTTP_USER_AGENT'],
'Request date' => date('Y/m/d H:i:s'),
]);

$html = $emailBuilder->build(
$bodyHtml,
'image/logo.png',
'image/logo.png',
nl2br(
'Made with passion, in France
© Phant ' . date('Y')
)
);

echo $html;
Binary file added demo/image/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 49e259f

Please sign in to comment.