From 37ec6da9428efaf0b44001e3954cdc05b61b707e Mon Sep 17 00:00:00 2001 From: Micheal Date: Fri, 30 Jan 2015 12:05:49 +0800 Subject: [PATCH] core_email --- Import/Core_email.php | 46 +++++++++++++++++++ .../mail/CORE_PERSON_SIGNUP_CONFIRM.txt~ | 5 ++ .../CORE_PERSON_SIGNUP_CONGRATULATION.txt~ | 5 ++ 3 files changed, 56 insertions(+) create mode 100644 Import/Core_email.php create mode 100644 templates/mail/CORE_PERSON_SIGNUP_CONFIRM.txt~ create mode 100644 templates/mail/CORE_PERSON_SIGNUP_CONGRATULATION.txt~ diff --git a/Import/Core_email.php b/Import/Core_email.php new file mode 100644 index 00000000..0431f515 --- /dev/null +++ b/Import/Core_email.php @@ -0,0 +1,46 @@ +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 index 00000000..e83a2a6b --- /dev/null +++ b/templates/mail/CORE_PERSON_SIGNUP_CONFIRM.txt~ @@ -0,0 +1,5 @@ +from_name:Roojs +from_email:no-reply@Roojs.com +subject:Verification +name:CORE_PERSON_SIGNUP_CONFIRM +bodytext:Dear {honor}

Thank you for your interest in HydRa here is your link to create your account. Please click the following link to activate.

{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 index 00000000..2646a07d --- /dev/null +++ b/templates/mail/CORE_PERSON_SIGNUP_CONGRATULATION.txt~ @@ -0,0 +1,5 @@ +from_name:Roojs +from_email:no-reply@Roojs.com +subject:Congratulations +name:CORE_PERSON_SIGNUP_CONGRATULATION +bodytext:Dear {honor}

Congratulations on Joining HydRa.

If you need to access the system again please log in using the password {password} -- 2.39.2