core_email
authorMicheal <micheal@roojs.com>
Fri, 30 Jan 2015 04:05:49 +0000 (12:05 +0800)
committerMicheal <micheal@roojs.com>
Fri, 30 Jan 2015 04:05:49 +0000 (12:05 +0800)
Import/Core_email.php [new file with mode: 0644]
templates/mail/CORE_PERSON_SIGNUP_CONFIRM.txt~ [new file with mode: 0644]
templates/mail/CORE_PERSON_SIGNUP_CONGRATULATION.txt~ [new file with mode: 0644]

diff --git a/Import/Core_email.php b/Import/Core_email.php
new file mode 100644 (file)
index 0000000..0431f51
--- /dev/null
@@ -0,0 +1,46 @@
+<?php
+
+
+
+require_once 'Pman/Roo.php';
+
+class Pman_Hydra_Import_Core_email extends Pman_Roo
+{
+       function getAuth()
+    {
+        $ff = HTML_FlexyFramework::get();
+        
+        if (!$ff->cli) {
+            die("cli only");
+        }
+        
+    }
+
+       function get(){
+               
+               $template_name = 'CORE_PERSON_SIGNUP_CONFIRM';
+               $c = DB_dataObject::factory('core_email');
+               $ret = $c->get('name',$template_name);
+               if($ret == 0){
+                       $mailtext = file_get_contents('Pman.Core/templates/mail/'.$template_name.'.txt');
+       
+                       require_once 'Mail/mimeDecode.php';  
+               $decoder = new Mail_mimeDecode($mailtext);
+               $parts = $decoder->getSendArray();
+               $from_name = explode(" ", $parts[0])[0];
+               $from_email = explode(" ", $parts[0])[1];
+               $c->setFrom(array(
+                       'from_name'=>$from_name,
+                       'from_email'=>$from_email,
+                       'subject'=>$parts[1]['Subject'],
+                       'name'=>$template_name,
+                       'bodytext'=>$parts[2]
+                       ));
+               $c->insert();
+               }else{
+                       print_r("template exists.");
+               }
+
+               die("done\n");
+       }
+}
\ No newline at end of file
diff --git a/templates/mail/CORE_PERSON_SIGNUP_CONFIRM.txt~ b/templates/mail/CORE_PERSON_SIGNUP_CONFIRM.txt~
new file mode 100644 (file)
index 0000000..e83a2a6
--- /dev/null
@@ -0,0 +1,5 @@
+from_name:Roojs
+from_email:no-reply@Roojs.com
+subject:Verification
+name:CORE_PERSON_SIGNUP_CONFIRM
+bodytext:Dear {honor}<br /><br />Thank you for your interest in HydRa here is your link to create your account. Please click the following link to activate.<br /><br />{link:h}
\ No newline at end of file
diff --git a/templates/mail/CORE_PERSON_SIGNUP_CONGRATULATION.txt~ b/templates/mail/CORE_PERSON_SIGNUP_CONGRATULATION.txt~
new file mode 100644 (file)
index 0000000..2646a07
--- /dev/null
@@ -0,0 +1,5 @@
+from_name:Roojs
+from_email:no-reply@Roojs.com
+subject:Congratulations
+name:CORE_PERSON_SIGNUP_CONGRATULATION
+bodytext:Dear {honor}<br /><br />Congratulations on Joining HydRa.<br /><br />If you need to access the system again please log in using the password {password}