PluginProbe
AcyMailing – An Ultimate Newsletter Plugin and Marketing Automation Solution for WordPress / 10.10.2
AcyMailing – An Ultimate Newsletter Plugin and Marketing Automation Solution for WordPress v10.10.2
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 10.10.2, at back/Helpers/global/mail.php

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