DataObjects/Core_email.php
authorjohn <john@roojs.com>
Thu, 11 Jan 2018 04:48:21 +0000 (12:48 +0800)
committerjohn <john@roojs.com>
Thu, 11 Jan 2018 04:48:21 +0000 (12:48 +0800)
DataObjects/Core_email.php

index 3f2b529..b6e2473 100644 (file)
@@ -341,10 +341,17 @@ class Pman_Core_DataObjects_Core_email extends DB_DataObject
             $contents['rcpts'] = $admin;
         }
         
+        //subject replacement
         if(empty($contents['subject'])){
            $contents['subject'] = $this->subject; 
         }
         
+        if (!empty($content['subject_replace'])) {
+            foreach ($content['mapping'] as $pattern => $replace) {
+                $content['subject'] = preg_replace($pattern,$replace,$content['subject']);
+            }
+        }
+        
         if(!empty($contents['rcpts']) && is_array($contents['rcpts'])){
             $contents['rcpts'] = implode(',', $contents['rcpts']);
         }