Permalink
Browse files

Text placeholder

Signed-off-by: Xheni Myrtaj <myrtajxheni@gmail.com>
  • Loading branch information...
xh3n1 authored and samtuke committed Feb 7, 2019
1 parent 49d4ce8 commit aeccfe007267d548ca2082eb22cd72cda78b12ae
Showing with 23 additions and 3 deletions.
  1. +21 −2 public_html/lists/admin/lib.php
  2. +2 −1 public_html/lists/admin/sendemaillib.php
@@ -2156,10 +2156,29 @@ function parseLogoPlaceholders($content)
return $content;
}
function parseVCardPlaceholder($content) {
/**
* Parse [CONTACT] as HTML placeholder for VCard
* @param $content
* @return mixed
*/
function parseVCardHTMLPlaceholder($content) {
preg_match_all('/\[CONTACT\:?(\d+)?\]/', $content, $contactInstances);
foreach ($contactInstances[0] as $index => $contactInstance) {
$content = str_replace($contactInstance, '<a href="'.htmlentities(getConfig('vcardurl')).' ">'.$GLOBALS['strContactMessage'].'</a>', $content);
}
return $content;
}
/**
* Parse [CONTACT] as Text placeholder for VCard
* @param $content
* @return mixed
*/
function parseVCardTextPlaceholder($content) {
preg_match_all('/\[CONTACT\:?(\d+)?\]/', $content, $contactInstances);
foreach ($contactInstances[0] as $index => $contactInstance) {
$content = str_replace($contactInstance, '<a href="'.htmlentities(getConfig('vcardurl')).' ">'.$GLOBALS['$strContactMessage'].'</a>',$content);
$content = str_replace($contactInstance, $GLOBALS['strContactMessage'].' '.htmlentities(getConfig('vcardurl')), $content);
}
return $content;
@@ -425,7 +425,8 @@ function sendEmail($messageid, $email, $hash, $htmlpref = 0, $rssitems = array()
// make sure to only include usertrack once, otherwise the stats would go silly
$htmlmessage = str_ireplace('[USERTRACK]', '', $htmlmessage);
$textmessage = str_ireplace('[USERTRACK]', '', $textmessage);
$htmlmessage = parseVCardPlaceholder($htmlmessage);
$htmlmessage = parseVCardHTMLPlaceholder($htmlmessage);
$textmessage = parseVCardTextPlaceholder($textmessage);
$html['subject'] = $cached[$messageid]['subject'];
$text['subject'] = $cached[$messageid]['subject'];

0 comments on commit aeccfe0

Please sign in to comment.