Skip to content

Commit 0842cff

Browse files
committed
- (Feature) Added settings to Test Email Service that allow users to send successful and failed responses
1 parent 355c0da commit 0842cff

File tree

2 files changed

+47
-2
lines changed

2 files changed

+47
-2
lines changed

models/Postmaster_TestServiceSettingsModel.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ class Postmaster_TestServiceSettingsModel extends Postmaster_ServiceSettingsMode
55
{
66
protected function defineAttributes()
77
{
8-
return array();
8+
return array(
9+
'status' => array(AttributeType::String, 'default' => 'success'),
10+
'code' => array(AttributeType::Number, 'default' => 200),
11+
'errors' => array(AttributeType::Mixed, 'default' => array()),
12+
);
913
}
1014
}
Lines changed: 42 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,42 @@
1-
<p>The Test Email Service allows you to test your configurations without actually sending any emails.<br>Responses will be added to the database as usual, so your testing will reflect an actual email response.</p>
1+
{% import "_includes/forms" as forms %}
2+
3+
<p>The Test Email Service allows you to test your configurations without actually sending any emails.<br>Responses will be added to the database as usual, so your testing will reflect an actual email response.</p>
4+
5+
{{ forms.selectField({
6+
label: "Status"|t,
7+
instructions: "The type of response status to return."|t,
8+
id: 'testing_status',
9+
name: 'settings[serviceSettings][testing][status]',
10+
value: settings.status,
11+
translatable: true,
12+
options: [{
13+
value: 'success',
14+
label: 'Success'
15+
},{
16+
value: 'failed',
17+
label: 'Failed'
18+
}]
19+
}) }}
20+
21+
{{ forms.textField({
22+
label: "Code"|t,
23+
instructions: "The code to return with the response."|t,
24+
id: 'testing_code',
25+
name: 'settings[serviceSettings][testing][code]',
26+
value: settings.code,
27+
translatable: true
28+
}) }}
29+
30+
{{ forms.editableTableField({
31+
label: "Errors",
32+
instructions: "Enter any errors you want to return with the response."|t,
33+
name: 'settings[serviceSettings][testing][errors]',
34+
id: 'http_errors',
35+
cols: {
36+
error: {
37+
heading: 'Error'|t,
38+
type: 'singleline'
39+
}
40+
},
41+
rows: settings.errors ? settings.errors : []
42+
}) }}

0 commit comments

Comments
 (0)