diff --git a/extension/Documentation/Manual.rst b/extension/Documentation/Manual.rst index 04b738e91f4fe0a1877734c6ff886081e92fb2a0..b9881b349f8e2c79768e4065b644d4bf9541c670 100644 --- a/extension/Documentation/Manual.rst +++ b/extension/Documentation/Manual.rst @@ -5506,10 +5506,19 @@ Column: _sendmail t:<TO:email[,email]>|f:<FROM:email>|s:<subject>|b:<body> [|c:<CC:email[,email]]>[|B:<BCC:email[,email]]>[|r:<REPLY-TO:email>] - [|a:<flag autosubmit: on /off>][|g:<grid>][|x:<xId>][|y:<xId2>][|z:<xId3>] + [|A:<flag autosubmit: on/off>][|g:<grId>][|x:<xId>][|y:<xId2>][|z:<xId3>] + [|e:<subject encode: encode/decode/none>][E:<body encode: encode/decode/none>] [|C][d:<filename of the attachment>][|F:<file to attach>][|u:<url>][|p:<T3 uri>] -Send text emails. Every mail will be logged in the table `mailLog`. Attachments are supported. +The following parameters can also be written out for ease of use: + +:: + + to:<email[,email]>|from:<email>|subject:<subject>|body:<body> + [|cc:<email[,email]]>[|bcc:<email[,email]]>[|reply-to:<email>] + [|autosubmit:<on/off>][|grid:<grid>][|xid:<xId>][|xid2:<xId2>][|xid3:<xId3>] + +Send emails. Every mail will be logged in the table `mailLog`. Attachments are supported. **Syntax** diff --git a/extension/qfq/qfq/Constants.php b/extension/qfq/qfq/Constants.php index 56c8e6ad93b5dafa65fb7a0c1cda0ed25a519527..e3a8c64e08223676fbac5c5cf11f4cf82131fa6b 100644 --- a/extension/qfq/qfq/Constants.php +++ b/extension/qfq/qfq/Constants.php @@ -1109,21 +1109,33 @@ const EXISTING_PATH_FILE_NAME = '_existingPathFileName'; //SENDMAIL const SENDMAIL_TOKEN_RECEIVER = 't'; +const SENDMAIL_TOKEN_RECEIVER_LONG = 'to'; const SENDMAIL_TOKEN_SENDER = 'f'; +const SENDMAIL_TOKEN_SENDER_LONG = 'from'; const SENDMAIL_TOKEN_SUBJECT = 's'; +const SENDMAIL_TOKEN_SUBJECT_LONG = 'subject'; const SENDMAIL_TOKEN_BODY = 'b'; +const SENDMAIL_TOKEN_BODY_LONG = 'body'; const SENDMAIL_TOKEN_REPLY_TO = 'r'; +const SENDMAIL_TOKEN_REPLY_TO_LONG = 'reply-to'; const SENDMAIL_TOKEN_FLAG_AUTO_SUBMIT = 'A'; +const SENDMAIL_TOKEN_FLAG_AUTO_SUBMIT_LONG = 'autosubmit'; const SENDMAIL_TOKEN_GR_ID = 'g'; +const SENDMAIL_TOKEN_GR_ID_LONG = 'grid'; const SENDMAIL_TOKEN_X_ID = 'x'; +const SENDMAIL_TOKEN_X_ID_LONG = 'xid'; +const SENDMAIL_TOKEN_X_ID2 = 'y'; +const SENDMAIL_TOKEN_X_ID2_LONG = 'xid2'; +const SENDMAIL_TOKEN_X_ID3 = 'z'; +const SENDMAIL_TOKEN_X_ID3_LONG = 'xid3'; const SENDMAIL_TOKEN_RECEIVER_CC = 'c'; +const SENDMAIL_TOKEN_RECEIVER_CC_LONG = 'cc'; const SENDMAIL_TOKEN_RECEIVER_BCC = 'B'; +const SENDMAIL_TOKEN_RECEIVER_BCC_LONG = 'bcc'; const SENDMAIL_TOKEN_ATTACHMENT = 'attachment'; const SENDMAIL_TOKEN_ATTACHMENT_FILE = 'F'; const SENDMAIL_TOKEN_ATTACHMENT_FILE_DEPRECATED = 'a'; // since 5.12.17 const SENDMAIL_TOKEN_HEADER = 'h'; -const SENDMAIL_TOKEN_X_ID2 = 'y'; -const SENDMAIL_TOKEN_X_ID3 = 'z'; const SENDMAIL_TOKEN_SUBJECT_HTML_ENTITY = 'e'; const SENDMAIL_TOKEN_BODY_HTML_ENTITY = 'E'; const SENDMAIL_TOKEN_SRC = 'S'; diff --git a/extension/qfq/qfq/report/SendMail.php b/extension/qfq/qfq/report/SendMail.php index e114ff09fb170ac38962e0edf0b19d77bf87354b..c5bc04ef34a21f31d88b45f333cf7ec6c79b6473 100644 --- a/extension/qfq/qfq/report/SendMail.php +++ b/extension/qfq/qfq/report/SendMail.php @@ -339,7 +339,7 @@ class SendMail { /** * Convert a token based sendMail string into an array. - * - Each attachment (single file or mulitple concatenated files) is an array in the array. + * - Each attachment (single file or multiple concatenated files) is an array in the array. * * @param string $data E.g.: 't:john@doe.com|f:jane@miller.com|s:Latest|b:Dear John ...' * @return array @@ -364,12 +364,14 @@ class SendMail { continue; } - $token = $line[0]; - - if (strlen($line) > 2 && $line[1] != PARAM_TOKEN_DELIMITER) { + $tokenAndValue = explode(PARAM_TOKEN_DELIMITER, $line, 2); + if (count($tokenAndValue) < 2) { throw new UserFormException('Missing token delimiter "' . PARAM_TOKEN_DELIMITER . '" in: ' . $line, ERROR_UNKNOWN_TOKEN); } + // speaking word tokens are all lowercase + $token = strlen($tokenAndValue[0]) > 1 ? strtolower($tokenAndValue[0]) : $tokenAndValue[0]; + // Check for deprecated token. if ($token == SENDMAIL_TOKEN_ATTACHMENT_FILE_DEPRECATED) { throw new UserFormException('Sendmail: Option "a:" is deprecated, please use "' . SENDMAIL_TOKEN_ATTACHMENT_FILE . '" instead', ERROR_UNKNOWN_TOKEN);