1{
2  "title": "SubmitFormSnippet",
3  "description": "A template with two states: a SimpleSnippet and another that contains a form",
4  "version": "1.2.0",
5  "type": "object",
6  "definitions": {
7    "plainText": {
8      "description": "Plain text (no HTML allowed)",
9      "type": "string"
10    },
11    "richText": {
12      "description": "Text with HTML subset allowed: i, b, u, strong, em, br",
13      "type": "string"
14    },
15    "link_url": {
16      "description": "Target for links or buttons",
17      "type": "string",
18      "format": "uri"
19    }
20  },
21  "properties": {
22    "locale": {
23      "type": "string",
24      "description": "Two to five character string for the locale code"
25    },
26    "country": {
27      "type": "string",
28      "description": "Two character string for the country code (used for SMS)"
29    },
30    "scene1_title": {
31      "allof": [
32        {"$ref": "#/definitions/plainText"},
33        {"description": "snippet title displayed before snippet text"}
34      ]
35    },
36    "scene1_text": {
37      "allOf": [
38        {"$ref": "#/definitions/richText"},
39        {"description": "Main body text of snippet. HTML subset allowed: i, b, u, strong, em, br"}
40      ]
41    },
42    "scene1_section_title_icon": {
43      "type": "string",
44      "description": "Section title icon for scene 1. 16x16px. SVG or PNG preferred. scene1_section_title_text must also be specified to display."
45    },
46    "scene1_section_title_icon_dark_theme": {
47      "type": "string",
48      "description": "Section title icon for scene 1, dark theme variant. 16x16px. SVG or PNG preferred. scene1_section_title_text must also be specified to display."
49    },
50    "scene1_section_title_text": {
51      "type": "string",
52      "description": "Section title text for scene 1. scene1_section_title_icon must also be specified to display."
53    },
54    "scene1_section_title_url": {
55      "allOf": [
56        {"$ref": "#/definitions/link_url"},
57        {"description": "A url, scene1_section_title_text links to this"}
58      ]
59    },
60    "scene2_title": {
61      "allOf": [
62        {"$ref": "#/definitions/plainText"},
63        {"description": "Title displayed before text in scene 2. Should be plain text."}
64      ]
65    },
66    "scene2_text": {
67      "allOf": [
68        {"$ref": "#/definitions/richText"},
69        {"description": "Main body text of snippet. HTML subset allowed: i, b, u, strong, em, br"}
70      ]
71    },
72    "scene1_icon": {
73      "type": "string",
74      "description": "Snippet icon. 64x64px. SVG or PNG preferred."
75    },
76    "scene1_icon_dark_theme": {
77      "type": "string",
78      "description": "Snippet icon. Dark theme variant. 64x64px. SVG or PNG preferred."
79    },
80    "scene1_icon_alt_text": {
81      "type": "string",
82      "description": "Alt text describing scene1 icon for screen readers",
83      "default": ""
84    },
85    "scene1_title_icon": {
86      "type": "string",
87      "description": "Small icon that shows up before the title / text. 16x16px. SVG or PNG preferred. Grayscale."
88    },
89    "scene1_title_icon_dark_theme": {
90      "type": "string",
91      "description": "Small icon that shows up before the title / text. Dark theme variant. 16x16px. SVG or PNG preferred. Grayscale."
92    },
93    "scene1_title_icon_alt_text": {
94      "type": "string",
95      "description": "Alt text describing scene1 title icon for screen readers",
96      "default": ""
97    },
98    "form_action": {
99      "type": "string",
100      "description": "Endpoint to submit form data."
101    },
102    "success_title": {
103      "type": "string",
104      "description": "(send to device) Title shown before text on successful registration."
105    },
106    "success_text": {
107      "type": "string",
108      "description": "Message shown on successful registration."
109    },
110    "error_text": {
111      "type": "string",
112      "description": "Message shown if registration failed."
113    },
114    "scene2_email_placeholder_text": {
115      "type": "string",
116      "description": "Value to show while input is empty."
117    },
118    "scene2_input_placeholder": {
119      "type": "string",
120      "description": "(send to device) Value to show while input is empty."
121    },
122    "scene2_button_label": {
123      "type": "string",
124      "description": "Label for form submit button"
125    },
126    "scene2_privacy_html": {
127      "type": "string",
128      "description": "Information about how the form data is used."
129    },
130    "scene2_disclaimer_html": {
131      "type": "string",
132      "description": "(send to device) Html for disclaimer and link underneath input box."
133    },
134    "scene2_dismiss_button_text": {
135      "type": "string",
136      "description": "Label for the dismiss button when the sign-up form is expanded."
137    },
138    "scene2_icon": {
139      "type": "string",
140      "description": "(send to device) Image to display above the form. 98x98px. SVG or PNG preferred."
141    },
142    "scene2_icon_dark_theme": {
143      "type": "string",
144      "description": "(send to device) Image to display above the form. Dark theme variant. 98x98px. SVG or PNG preferred."
145    },
146    "scene2_icon_alt_text": {
147      "type": "string",
148      "description": "Alt text describing scene2 icon for screen readers",
149      "default": ""
150    },
151    "scene2_newsletter": {
152      "type": "string",
153      "description": "Newsletter/basket id user is subscribing to. Must be a value from the 'Slug' column here: https://basket.mozilla.org/news/. Default 'mozilla-foundation'."
154    },
155    "hidden_inputs": {
156      "type": "object",
157      "description": "Each entry represents a hidden input, key is used as value for the name property."
158    },
159    "scene1_button_label": {
160      "allOf": [
161        {"$ref": "#/definitions/plainText"},
162        {"description": "Text for a button next to main snippet text that links to button_url. Requires button_url."}
163      ]
164    },
165    "scene1_button_color": {
166      "type": "string",
167      "description": "The text color of the button. Valid CSS color."
168    },
169    "scene1_button_background_color": {
170      "type": "string",
171      "description": "The background color of the button. Valid CSS color."
172    },
173    "retry_button_label": {
174      "allOf": [
175        {"$ref": "#/definitions/plainText"},
176        {"description": "Text for the button in the event of a submission error/failure."}
177      ],
178      "default": "Try again"
179    },
180    "do_not_autoblock": {
181      "type": "boolean",
182      "description": "Used to prevent blocking the snippet after the CTA (link or button) has been clicked"
183    },
184    "include_sms": {
185      "type": "boolean",
186      "description": "(send to device) Allow users to send an SMS message with the form?"
187    },
188    "message_id_sms": {
189      "type": "string",
190      "description": "(send to device) Newsletter/basket id representing the SMS message to be sent."
191    },
192    "message_id_email": {
193      "type": "string",
194      "description": "(send to device) Newsletter/basket id representing the email message to be sent. Must be a value from the 'Slug' column here: https://basket.mozilla.org/news/."
195    },
196    "utm_campaign": {
197      "type": "string",
198      "description": "(fxa) Value to pass through to GA as utm_campaign."
199    },
200    "utm_term": {
201      "type": "string",
202      "description": "(fxa) Value to pass through to GA as utm_term."
203    },
204    "links": {
205      "additionalProperties": {
206        "url": {
207          "allOf": [
208            {"$ref": "#/definitions/link_url"},
209            {"description": "The url where the link points to."}
210          ]
211        },
212        "metric": {
213          "type": "string",
214          "description": "Custom event name sent with telemetry event."
215        }
216      }
217    }
218  },
219  "additionalProperties": false,
220  "required": ["scene1_text", "scene2_text", "scene1_button_label"],
221  "dependencies": {
222    "scene1_button_color": ["scene1_button_label"],
223    "scene1_button_background_color": ["scene1_button_label"]
224  }
225}
226