7094 |
florian |
1 |
<style>
|
|
|
2 |
.email-logo { padding-bottom: 10px; }
|
|
|
3 |
.email-logo-watermark { position:absolute; top:10%; left:0; right:0; display:flex; justify-content:center; align-items:center; }
|
|
|
4 |
</style>
|
|
|
5 |
|
|
|
6 |
<?php
|
|
|
7 |
if($this->get_option('wpsg_email_logo_activated'))
|
|
|
8 |
{
|
|
|
9 |
|
|
|
10 |
$logoWatermark = $this->get_option('wpsg_email_logo_watermark') ? "email-logo-watermark" : "";
|
|
|
11 |
|
|
|
12 |
$logoTransparency = str_replace("#", "", get_option('wpsg_email_logo_transparency'));
|
|
|
13 |
if($logoTransparency !== "100") $logoTransparency = str_replace(array("0", "00"), "", $logoTransparency);
|
|
|
14 |
if($logoTransparency !== "100") $logoTransparency = "0." . $logoTransparency;
|
|
|
15 |
|
|
|
16 |
$logoAlignment = $this->get_option('wpsg_email_logo_alignment');
|
|
|
17 |
$logoPath = WPSG_PATH_CONTENT . 'uploads/wpsg/wpsg_mailconf/wpsg_email_logo.jpg';
|
|
|
18 |
|
|
|
19 |
if(file_exists($logoPath))
|
|
|
20 |
{
|
|
|
21 |
$logoType = pathinfo($logoPath);
|
|
|
22 |
$logoData = file_get_contents($logoPath);
|
|
|
23 |
$logoBase64 = 'data:image/' . $logoType . ';base64,' . base64_encode($logoData);
|
|
|
24 |
}
|
|
|
25 |
|
|
|
26 |
}
|
|
|
27 |
?>
|
|
|
28 |
|
|
|
29 |
<?php if(file_exists($logoPath) && $this->get_option('wpsg_email_logo_activated')) { ?>
|
|
|
30 |
<?php echo "<div class='email-logo $logoWatermark' style='text-align:$logoAlignment; opacity:$logoTransparency;'>" ?>
|
|
|
31 |
<?php echo "<img alt='Emaillogo' class='email-logo-$logoAlignment' src='$logoBase64'>"; ?>
|
|
|
32 |
<?php echo "</div>"; ?>
|
|
|
33 |
<?php } ?>
|