File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -48,24 +48,33 @@ Create a screenshot submission for all default apps:
4848``` ruby
4949submission = PreflightQA ::Screenshots .create(
5050 subject: " My Test Email" ,
51- html: " <html><body>Hello world</body></html>" ,
52- webhook_url: " https://example.com/preflight/webhook"
51+ html: " <html><body>Hello world</body></html>"
5352)
5453
5554submission.uuid
5655submission.status
5756submission.code
5857```
5958
59+ ` webhook_url ` is optional. If you want PreflightQA to notify your app when rendering is finished, pass it explicitly:
60+
61+ ``` ruby
62+ submission = PreflightQA ::Screenshots .create(
63+ subject: " My Test Email" ,
64+ html: " <html><body>Hello world</body></html>" ,
65+ webhook_url: " https://example.com/preflight/webhook"
66+ )
67+ ```
68+
6069You can also limit the request to specific apps and modes:
6170
6271``` ruby
6372submission = PreflightQA ::Screenshots .create(
6473 subject: " My Test Email" ,
6574 html: " <html><body>Hello world</body></html>" ,
6675 apps: {
67- apple_mail_mac: [:light , :dark ],
68- outlook_mac: [:light ]
76+ apple_mail_mac: { modes: [:light , :dark ] } ,
77+ outlook_mac: { modes: [:light ] }
6978 }
7079)
7180```
Original file line number Diff line number Diff line change @@ -54,7 +54,7 @@ def normalize_apps(apps)
5454 raise ArgumentError , "apps must be a hash of app keys to mode arrays" unless apps . is_a? ( Hash )
5555
5656 apps . each_with_object ( { } ) do |( app , modes ) , normalized |
57- normalized [ app . to_s ] = normalize_modes ( modes )
57+ normalized [ app . to_s ] = { modes : normalize_modes ( modes ) }
5858 end
5959 end
6060 private_class_method :normalize_apps
Original file line number Diff line number Diff line change 4343 body : {
4444 subject : "My Test Email" ,
4545 html : "<html>test</html>" ,
46- apps : { "apple_mail_mac" => %w[ light dark ] } ,
46+ apps : { "apple_mail_mac" => { modes : %w[ light dark ] } } ,
4747 webhook_url : "https://example.test/webhook" ,
4848 locale : "en-GB"
4949 }
You can’t perform that action at this time.
0 commit comments