PluginProbe
AcyMailing – An Ultimate Newsletter Plugin and Marketing Automation Solution for WordPress / 11.0.5
AcyMailing – An Ultimate Newsletter Plugin and Marketing Automation Solution for WordPress v11.0.5
11.1.1 11.1.0 11.0.5 11.0.4 11.0.3 11.0.2 11.0.1 11.0.0 10.11.1 10.11.0 10.10.2 10.10.1 10.10.0 10.9.1 trunk 10.0.0 10.0.1 10.1.0 10.1.1 10.1.2 10.1.3 10.1.4 10.2.0 10.2.1 10.2.2 All 62 releases
acymailing / back / Helpers / global / mail.php

mail.php in AcyMailing – An Ultimate Newsletter Plugin and Marketing Automation Solution for WordPress 11.0.5, at back/Helpers/global/mail.php

53 lines 1.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 defined('ABSPATH') || die('Restricted Access');
3
4 function acym_getEmailCssFixes(): string
5 {
6 $emailFixes = acym_fileGetContent(ACYM_MEDIA.'css'.DS.'email.min.css');
7
8 $config = acym_config();
9 if ('1' === $config->get('prevent_hyphens', '')) {
10 $emailFixes .= 'table td.acym__wysid__column__element__td, table td.acym__wysid__column__element__td p { word-break: break-word; -webkit-hyphens: none; -moz-hyphens: none; hyphens: none; mso-hyphenate: none; }';
11 }
12
13 return $emailFixes;
14 }
15
16 function acym_getMailThumbnail(?string $thumbnail): string
17 {
18 $sources = [
19 '',
20 ACYM_TEMPLATE_THUMBNAILS,
21 ACYM_IMAGES.'thumbnails/',
22 ];
23
24 if (!empty($thumbnail)) {
25 foreach ($sources as $oneSource) {
26 if (file_exists(str_replace(acym_rootURI(), ACYM_ROOT, $oneSource.$thumbnail))) {
27 return $oneSource.$thumbnail;
28 }
29 }
30 }
31
32 return ACYM_IMAGES.'templates/default_template_thumbnail.png';
33 }
34
35 function acym_getFlagByCode(string $code): string
36 {
37 $code = explode('-', $code);
38 $finalCode = '';
39
40 foreach ($code as $part) {
41 $part = strtolower($part);
42 if (file_exists(ACYM_MEDIA.'images'.DS.'flags'.DS.$part.'.png')) {
43 $finalCode = $part;
44 }
45 }
46
47 if (empty($finalCode)) {
48 $finalCode = 'unknown';
49 }
50
51 return ACYM_IMAGES.'flags/'.$finalCode.'.png';
52 }
53