Commit d9fa1e8 1 parent 8d1da2e commit d9fa1e8 Copy full SHA for d9fa1e8
File tree 2 files changed +15
-3
lines changed
2 files changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -156,6 +156,11 @@ require_once(
156
156
* Description: Display a failure message to user when sending is failed, or just log it.
157
157
* Valid values: `boolean`
158
158
* Default value: `true`
159
+
160
+ * ` senders->{$senderName}->isFailRequiredParamsDisplayedToLog `
161
+ * Description: Display a failure message to the CMS log when required parameters are not set.
162
+ * Valid values: `boolean`
163
+ * Default value: `true`
159
164
160
165
161
166
#### Senders → Email
Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ abstract class Sender extends \DDTools\Base\Base {
14
14
$ text = '' ,
15
15
$ textMarkupSyntax = 'html ' ,
16
16
$ isFailDisplayedToUser = true ,
17
+ $ isFailRequiredParamsDisplayedToLog = true ,
17
18
18
19
$ requiredProps = ['tpl ' ],
19
20
$ canSend = true ,
@@ -176,7 +177,7 @@ private final function initPostPlaceholders(){
176
177
177
178
/**
178
179
* send
179
- * @version 1.7.5 (2024-07-13 )
180
+ * @version 1.8 (2024-07-14 )
180
181
*
181
182
* @desc Sends a message.
182
183
*
@@ -187,13 +188,19 @@ public function send(){
187
188
$ errorData = (object ) [
188
189
'isError ' => true ,
189
190
//Only 19 signs are allowed here in MODX event log :|
190
- 'title ' => 'Check required parameters ' ,
191
+ 'title ' => '' ,
191
192
'message ' => '' ,
192
193
];
193
194
194
195
$ requestResult = null ;
195
196
196
- if ($ this ->canSend ){
197
+ if (!$ this ->canSend ){
198
+ $ errorData ->title = 'Check required parameters ' ;
199
+
200
+ if (!$ this ->isFailRequiredParamsDisplayedToLog ){
201
+ $ errorData ->isError = false ;
202
+ }
203
+ }else {
197
204
$ errorData ->title = 'Unexpected API error ' ;
198
205
199
206
if (!$ this ->send_auth ()){
You can’t perform that action at this time.
0 commit comments