|
|
| $logmode |
| |
|
| $logfile |
| |
|
| $header |
| |
|
| $mailcmd |
| |
|
| $mailto |
| |
|
| $mailfrom |
| |
|
| $mailfromname |
| |
|
| $replyto |
| |
|
| $script |
| |
|
| $subject |
| |
|
| $msgbody |
| |
|
| $line |
| |
|
| $file |
| |
|
| $callingfunction |
| |
|
| $physfile |
| |
|
| $error |
| |
|
| $server_id |
| |
|
| $sql |
| |
|
| $errdate |
| |
|
| $cu |
| |
|
| $member |
| |
Definition at line 9 of file errormail.i.
◆ getAwsSesLoggingContextJsonString()
| ErrorMail::getAwsSesLoggingContextJsonString |
( |
| ) |
|
|
private |
Prepare a a dictionary of {context: "json ob"} –context option for Python Email Sending Script
Definition at line 84 of file errormail.i.
90 $context[
"cucode"] = $this->cu;
91 $context[
"callingScript"] = $this->file;
92 $context[
"callingFunction"] = $this->callingfunction;
93 $context[
"serverName"] = $this->server;
94 $context[
"ServerScript"] = $this->script;
96 return HCU_JsonEncode($context);
◆ getPyFileLocation()
| ErrorMail::getPyFileLocation |
( |
| ) |
|
|
private |
Obtain a python file that will send the email.
Definition at line 70 of file errormail.i.
71 # Goal is to default it with a script with more generalized functionality 72 # added in sendSESEmailBulk.py script 74 return dirname(__FILE__) .
"/../scripts/sendSESEmailBulk.py";
76 return dirname(__FILE__) .
"/../scripts/sendSESEmail.py";
◆ SendErr()
function SendErr() This sends an email pointing out an error. At this point in time, all references in Odyssey have not been updated. No, this is not the email in Mammoth which comes from the error handler.
Definition at line 184 of file errormail.i.
185 $pyFile = $this->pyFile;
188 $msg .=
"Error in $this->script on Server $this->server\\n";
189 $msg .=
"Called as $this->query\\n\\n";
190 $msg .= $this->line ==
"" ?
"" :
"LINE: $this->line\\n";
191 $msg .= $this->file ==
"" ?
"" :
"FILE: $this->file\\n";
192 $msg .= $this->error ==
"" ?
"" :
"ERROR: $this->error\\n";
193 $msg .= $this->sql ==
"" ?
"" :
"SQL: $this->sql\\n";
194 $msg .= $this->cu ==
"" ?
"" :
"CU: $this->cu\\n";
195 $msg .= $this->member ==
"" ?
"" :
"MEMBER: $this->member\\n";
199 $plainTextString =
"--plaintext \"`echo " . escapeshellarg($msg) .
"`\"";
202 $subject =
"Error in $this->script";
203 $subjectString =
"--subject " . escapeshellarg($subject);
206 $fromString =
"--efrom " . escapeshellarg($this->mailfrom);
209 $toArray = is_array($this->mailto) ? $this->mailto : explode(
";", str_replace(
",",
";", strval($this->mailto)));
210 $toSwitch = $this->hideto ?
"--bcc" :
"--to";
215 foreach($toArray as $toEmail) {
216 if (trim($toEmail) !=
"") {
217 $toList[] = escapeshellarg($toEmail);
219 if (count($toList) >= 50) {
220 $toString =
"$toSwitch " . implode(
" ", $toList);
221 $cmd =
"(python3 $pyFile $toString $fromString $subjectString $plainTextString $awsSesLoggingContext) &";
228 $toString =
"$toSwitch " . implode(
" ", $toList);
229 $cmd =
"(python3 $pyFile $toString $fromString $subjectString $plainTextString $awsSesLoggingContext) &";
getAwsSesLoggingContextJsonString()
◆ SendMail()
function SendMail() Send an email through AWS SES. Like the previous implemention, the email is sent in the background. That means that there is no checking to see if the email has failed. For AWS SES fails are: 1) Invalid syntax of either from or to emails (should be checked before), 2) The From email is not verified (at this point in time, the default of norep.nosp@m.ly@h.nosp@m.omecu.nosp@m..net is not verified.), For more information,
- See also
- the sendSESEmail.py script.
Definition at line 111 of file errormail.i.
115 $from = $this->mailfromname !=
'' ?
"{$this->mailfromname} <{$this->mailfrom}>" : $this->mailfrom;
116 $fromString =
"--efrom " . escapeshellarg($from);
119 $replyToString = $this->replyto !=
"" ?
"--replyto " . escapeshellarg($this->replyto) :
"";
122 $subjectString =
"--subject " . escapeshellarg($this->subject);
128 if ($this->htmlMsgbody !=
"") {
129 $htmlTextBody = $this->htmlMsgbody;
131 if ($this->plainMsgbody !=
"") {
132 $plainTextBody = $this->plainMsgbody;
134 if ($this->msgbody !=
"") {
135 if (trim(strtolower($this->header)) ==
"content-type: text/html") {
136 $htmlTextBody = $this->msgbody;
138 $plainTextBody = $this->msgbody;
143 $plainTextString =
"";
144 $htmlTextString =
"";
145 if ($plainTextBody !=
"") {
147 $plainTextBody = str_replace(
"\n",
"\\n", str_replace(
"\r\n",
"\\r\\n", $plainTextBody));
148 $plainTextString =
"--plaintext \"`echo " . escapeshellarg($plainTextBody) .
"`\"";
150 if ($htmlTextBody !=
"") {
152 $htmlTextString =
"--htmltext " . escapeshellarg($htmlTextBody);
155 if ($plainTextString ==
"" && $htmlTextString ==
"") {
156 $plainTextString =
"--plaintext ''";
160 $toArray = is_array($this->mailto) ? $this->mailto : explode(
";", str_replace(
",",
";", strval($this->mailto)));
161 $toSwitch = $this->hideto ?
"--bcc" :
"--to";
162 $executeQuietly = $this->executeQuietly ?
"--quiet" :
"";
165 $toArray = array_map(
"trim", $toArray);
166 $toArray = array_map(
"escapeshellarg", $toArray);
168 $toString =
"$toSwitch " . implode(
" ", $toArray);
172 $cmd =
"(python3 $pyFile $toString $fromString $subjectString $plainTextString \ 173 $htmlTextString $replyToString $executeQuietly $awsSesLoggingContext) > /dev/null &";
getAwsSesLoggingContextJsonString()
The documentation for this class was generated from the following file: