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