1
|
|
|
<?php |
2
|
|
|
/* |
3
|
|
|
* Copyright (c) 2007, salesforce.com, inc. |
4
|
|
|
* All rights reserved. |
5
|
|
|
* |
6
|
|
|
* Redistribution and use in source and binary forms, with or without modification, are permitted provided |
7
|
|
|
* that the following conditions are met: |
8
|
|
|
* |
9
|
|
|
* Redistributions of source code must retain the above copyright notice, this list of conditions and the |
10
|
|
|
* following disclaimer. |
11
|
|
|
* |
12
|
|
|
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and |
13
|
|
|
* the following disclaimer in the documentation and/or other materials provided with the distribution. |
14
|
|
|
* |
15
|
|
|
* Neither the name of salesforce.com, inc. nor the names of its contributors may be used to endorse or |
16
|
|
|
* promote products derived from this software without specific prior written permission. |
17
|
|
|
* |
18
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED |
19
|
|
|
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A |
20
|
|
|
* PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR |
21
|
|
|
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED |
22
|
|
|
* TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) |
23
|
|
|
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING |
24
|
|
|
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
25
|
|
|
* POSSIBILITY OF SUCH DAMAGE. |
26
|
|
|
*/ |
27
|
|
|
define ("EMAIL_PRIORITY_HIGHEST", 'Highest'); |
|
|
|
|
28
|
|
|
define ("EMAIL_PRIORITY_HIGH", 'High'); |
|
|
|
|
29
|
|
|
define ("EMAIL_PRIORITY_NORMAL", 'Normal'); |
|
|
|
|
30
|
|
|
define ("EMAIL_PRIORITY_LOW", 'Low'); |
|
|
|
|
31
|
|
|
define ("EMAIL_PRIORITY_LOWEST", 'Lowest'); |
|
|
|
|
32
|
|
|
|
33
|
|
|
class Email { |
34
|
|
|
public function setBccSender($bccSender) { |
|
|
|
|
35
|
|
|
$this->bccSender = $bccSender; |
36
|
|
|
} |
37
|
|
|
|
38
|
|
|
public function setEmailPriority($priority) { |
|
|
|
|
39
|
|
|
$this->emailPriority = $priority; |
40
|
|
|
} |
41
|
|
|
|
42
|
|
|
public function setSubject($subject) { |
|
|
|
|
43
|
|
|
$this->subject = $subject; |
44
|
|
|
} |
45
|
|
|
|
46
|
|
|
public function setSaveAsActivity($saveAsActivity) { |
|
|
|
|
47
|
|
|
$this->saveAsActivity = $saveAsActivity; |
48
|
|
|
} |
49
|
|
|
|
50
|
|
|
public function setReplyTo($replyTo) { |
|
|
|
|
51
|
|
|
$this->replyTo = $replyTo; |
52
|
|
|
} |
53
|
|
|
|
54
|
|
|
public function setUseSignature($useSignature) { |
|
|
|
|
55
|
|
|
$this->useSignature = $useSignature; |
56
|
|
|
} |
57
|
|
|
|
58
|
|
|
public function setSenderDisplayName($name) { |
|
|
|
|
59
|
|
|
$this->senderDisplayName = $name; |
60
|
|
|
} |
61
|
|
|
} |
62
|
|
|
|
63
|
|
|
class SingleEmailMessage extends Email { |
64
|
|
|
public function __construct() {} |
65
|
|
|
|
66
|
|
|
|
67
|
|
|
public function setBccAddresses($addresses) { |
|
|
|
|
68
|
|
|
$this->bccAddresses = $addresses; |
69
|
|
|
} |
70
|
|
|
public $ccAddresses; |
71
|
|
|
|
72
|
|
|
public function setCcAddresses($addresses) { |
|
|
|
|
73
|
|
|
$this->ccAddresses = $addresses; |
74
|
|
|
} |
75
|
|
|
|
76
|
|
|
public function setCharset($charset) { |
|
|
|
|
77
|
|
|
$this->charset = $charset; |
78
|
|
|
} |
79
|
|
|
|
80
|
|
|
public function setHtmlBody($htmlBody) { |
|
|
|
|
81
|
|
|
$this->htmlBody = $htmlBody; |
82
|
|
|
} |
83
|
|
|
|
84
|
|
|
public function setOrgWideEmailAddressId($orgWideEmailAddressId) { |
|
|
|
|
85
|
|
|
$this->orgWideEmailAddressId = $orgWideEmailAddressId; |
86
|
|
|
} |
87
|
|
|
|
88
|
|
|
public function setPlainTextBody($plainTextBody) { |
|
|
|
|
89
|
|
|
$this->plainTextBody = $plainTextBody; |
90
|
|
|
} |
91
|
|
|
|
92
|
|
|
public function setTargetObjectId($targetObjectId) { |
|
|
|
|
93
|
|
|
$this->targetObjectId = $targetObjectId; |
94
|
|
|
} |
95
|
|
|
|
96
|
|
|
public function setTemplateId($templateId) { |
|
|
|
|
97
|
|
|
$this->templateId = $templateId; |
98
|
|
|
} |
99
|
|
|
|
100
|
|
|
public function setToAddresses($array) { |
|
|
|
|
101
|
|
|
$this->toAddresses = $array; |
102
|
|
|
} |
103
|
|
|
|
104
|
|
|
public function setWhatId($whatId) { |
|
|
|
|
105
|
|
|
$this->whatId = $whatId; |
106
|
|
|
} |
107
|
|
|
|
108
|
|
|
public function setFileAttachments($array) { |
|
|
|
|
109
|
|
|
$this->fileAttachments = $array; |
110
|
|
|
} |
111
|
|
|
|
112
|
|
|
public function setDocumentAttachments($array) { |
|
|
|
|
113
|
|
|
$this->documentAttachments = $array; |
114
|
|
|
} |
115
|
|
|
} |
116
|
|
|
|
117
|
|
|
class MassEmailMessage extends Email { |
118
|
|
|
public function setTemplateId($templateId) { |
|
|
|
|
119
|
|
|
$this->templateId = $templateId; |
120
|
|
|
} |
121
|
|
|
|
122
|
|
|
public function setWhatIds($array) { |
|
|
|
|
123
|
|
|
$this->whatIds = $array; |
124
|
|
|
} |
125
|
|
|
|
126
|
|
|
public function setTargetObjectIds($array) { |
|
|
|
|
127
|
|
|
$this->targetObjectIds = $array; |
128
|
|
|
} |
129
|
|
|
} |
130
|
|
|
?> |