-
Notifications
You must be signed in to change notification settings - Fork 0
/
kmail.php
98 lines (70 loc) · 2.73 KB
/
kmail.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
<?php
use kmailTools\KLog;
use kmailTools\KMailingListAdder;
use kmailTools\KMailSender;
use KMail_handler\KMailProject;
use KMail_handler\KContactFormHandler;
//use Kmail_contacts\KMailContact;
require_once 'kmailTools/KMailingListAdder.php';
require_once 'kmailTools/KLog.php';
require_once 'kmailTools/KMailSender.php';
require_once 'KMail_handler/KMailProject.php';
require_once 'KMail_handler/KContactFormHandler.php';
$projectInfo = [
"apiKey"=> 'f0166eb5113e25b967e247700dd8c895',
"apiSecret" => '6b936756be02c7c046b95eeeeaf71921',
"businessRecipientList"=>[ ["Email"=>"[email protected]"]],
"itRecipientList"=>[ ["Email"=>"[email protected]"] ,["Email"=>"[email protected]"] ],
"outboundEmailForContactForm"=>"[email protected]" ,
"projectName"=>"Heart mind equation"
];
try
{
$menu = ["sendEmailFromContactform"=>"sendEmailFromContactform",
"registerToList" =>"registerToList"];
/*
* visitorsName: Herman Duquerronette
visitorsphone: [email protected]
visitorsServiceSolicited: not specified
visitorsMessage: [email protected]
command: sendEmailFromContactform
* */
$received = ["visitorsName"=>"Herman Duquerronette"
,"visitorsphone"=>"Herman Duquerronette"
,"visitorsEmail"=>"[email protected]"
,"visitorsServiceSolicited"=>"not specified"
,"visitorsMessage"=>"test message"
,"command"=>"sendEmailFromContactform"
];//$_POST;
$chosenCommand = $received["command"];
////////////////////
$log = new KLog();
$log->setLogOn();
$log->log("will test sending email");
// $contact = new KMailContact("herman","[email protected]");
/* $apiKey = 'f0166eb5113e25b967e247700dd8c895';
$apiSecret = '6b936756be02c7c046b95eeeeaf71921';
$projectName = "test";*/
// $mailSender = new KMailSender($apiKey, $apiSecret, $projectName);
// $mailSender->sendEMail("[email protected]",["Email"=>"[email protected]"] , "hihi his is a test");
call_user_func($chosenCommand, $received);
// $adder = new KMailingListAdder($apiKey, $apiSecret, $projectName);
// $adder->createContact("herman", "[email protected]");
// $adder->addContacToAList("herman", "[email protected]", "1905");
// $log->log("called it");
}
catch (Exception $e)
{
echo "something is wrong";
$log = new KLog();
$log->setLogOn();
$log->log($e->getMessage());
}
function sendEmailFromContactform($emailInfo)
{
global $projectInfo;
$project = new KMailProject($projectInfo);
$handlerCommand = new KContactFormHandler($project);
$handlerCommand->execute($emailInfo);
}
?>