warb 0.1.4 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.rubocop.yml +5 -12
- data/README.md +9 -32
- data/Rakefile +3 -3
- data/docs/README.md +1 -4
- data/docs/components/README.md +1 -4
- data/docs/messages/README.md +1 -2
- data/docs/messages/flow.md +5 -241
- data/docs/messages/interactive_call_to_action_url.md +9 -9
- data/docs/messages/interactive_list.md +2 -2
- data/docs/messages/interactive_reply_button.md +9 -9
- data/docs/setup.md +1 -45
- data/examples/audio.rb +10 -10
- data/examples/document.rb +34 -34
- data/examples/image.rb +22 -22
- data/examples/interactive_call_to_action_url.rb +46 -46
- data/examples/interactive_list.rb +61 -61
- data/examples/interactive_reply_button.rb +43 -43
- data/examples/location.rb +32 -32
- data/examples/location_request.rb +11 -11
- data/examples/message.rb +8 -8
- data/examples/sticker.rb +10 -10
- data/examples/video.rb +22 -22
- data/examples/webhook.rb +43 -77
- data/lib/warb/client.rb +5 -7
- data/lib/warb/components/action.rb +8 -12
- data/lib/warb/configuration.rb +1 -4
- data/lib/warb/connection.rb +9 -15
- data/lib/warb/dispatcher.rb +3 -4
- data/lib/warb/dispatcher_concern.rb +0 -6
- data/lib/warb/indicator_dispatcher.rb +4 -4
- data/lib/warb/media_dispatcher.rb +10 -10
- data/lib/warb/resources/audio.rb +1 -1
- data/lib/warb/resources/contact.rb +20 -22
- data/lib/warb/resources/document.rb +1 -1
- data/lib/warb/resources/flow.rb +20 -82
- data/lib/warb/resources/image.rb +1 -1
- data/lib/warb/resources/interactive_call_to_action_url.rb +8 -10
- data/lib/warb/resources/interactive_list.rb +5 -7
- data/lib/warb/resources/interactive_reply_button.rb +8 -10
- data/lib/warb/resources/location.rb +1 -11
- data/lib/warb/resources/location_request.rb +3 -5
- data/lib/warb/resources/reaction.rb +1 -1
- data/lib/warb/resources/resource.rb +4 -14
- data/lib/warb/resources/sticker.rb +1 -1
- data/lib/warb/resources/text.rb +3 -31
- data/lib/warb/resources/video.rb +1 -1
- data/lib/warb/utils.rb +1 -3
- data/lib/warb/version.rb +1 -1
- data/lib/warb.rb +31 -67
- metadata +3 -34
- data/docs/components/button.md +0 -62
- data/docs/components/copy_code_button.md +0 -57
- data/docs/components/flow_button.md +0 -102
- data/docs/components/url_button.md +0 -57
- data/docs/messages/template.md +0 -373
- data/docs/resources/README.md +0 -14
- data/docs/resources/currency.md +0 -22
- data/docs/resources/date_time.md +0 -11
- data/docs/resources/text.md +0 -9
- data/lib/warb/category.rb +0 -8
- data/lib/warb/components/button.rb +0 -29
- data/lib/warb/components/component.rb +0 -19
- data/lib/warb/components/copy_code_button.rb +0 -30
- data/lib/warb/components/flow_button.rb +0 -32
- data/lib/warb/components/quick_reply_button.rb +0 -15
- data/lib/warb/components/url_button.rb +0 -30
- data/lib/warb/components/voice_call_button.rb +0 -15
- data/lib/warb/errors.rb +0 -27
- data/lib/warb/language.rb +0 -8
- data/lib/warb/resources/currency.rb +0 -47
- data/lib/warb/resources/date_time.rb +0 -34
- data/lib/warb/resources/helpers/header.rb +0 -35
- data/lib/warb/resources/template.rb +0 -163
- data/lib/warb/resources/validation.rb +0 -30
- data/lib/warb/response.rb +0 -33
- data/lib/warb/response_error_handler.rb +0 -42
- data/lib/warb/template_dispatcher.rb +0 -21
data/examples/document.rb
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
require_relative
|
|
3
|
+
require_relative "../lib/warb"
|
|
4
4
|
|
|
5
5
|
# Configure your variables here
|
|
6
6
|
|
|
7
|
-
access_token =
|
|
8
|
-
business_id =
|
|
9
|
-
sender_id =
|
|
10
|
-
recipient_number =
|
|
7
|
+
access_token = ""
|
|
8
|
+
business_id = ""
|
|
9
|
+
sender_id = ""
|
|
10
|
+
recipient_number = ""
|
|
11
11
|
|
|
12
|
-
document_link =
|
|
12
|
+
document_link = ""
|
|
13
13
|
|
|
14
14
|
# We recommend testing one section at a time, as it can be overwhelming to see all the messages at once.
|
|
15
15
|
# So you can comment out the sections you don't want to test.
|
|
@@ -25,8 +25,8 @@ warb_from_setup = Warb.setup do |config|
|
|
|
25
25
|
end
|
|
26
26
|
|
|
27
27
|
# To send document using its ID, you may need to retrieve it first, which can be retrieved this way
|
|
28
|
-
file_path =
|
|
29
|
-
file_type =
|
|
28
|
+
file_path = "" # fill this in with the file path pointing to wherever the document is located
|
|
29
|
+
file_type = "" # fill this in with the mimetype of the document to be uploaded
|
|
30
30
|
# allow values for file_type:
|
|
31
31
|
# text/plain, application/vnd.ms-excel, application/msword
|
|
32
32
|
# application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-powerpoint,
|
|
@@ -35,22 +35,22 @@ document_id = warb_from_setup.document.upload(file_path: file_path, file_type: f
|
|
|
35
35
|
# if you already have a document id, you can simply replace the above line with such id
|
|
36
36
|
|
|
37
37
|
warb_from_setup.document.dispatch(recipient_number, media_id: document_id)
|
|
38
|
-
warb_from_setup.document.dispatch(recipient_number, media_id: document_id, filename:
|
|
39
|
-
warb_from_setup.document.dispatch(recipient_number, media_id: document_id, caption:
|
|
38
|
+
warb_from_setup.document.dispatch(recipient_number, media_id: document_id, filename: "optional_name.pdf")
|
|
39
|
+
warb_from_setup.document.dispatch(recipient_number, media_id: document_id, caption: "OPTIONAL - Document caption")
|
|
40
40
|
warb_from_setup.document.dispatch(recipient_number, link: document_link)
|
|
41
|
-
warb_from_setup.document.dispatch(recipient_number, link: document_link, filename:
|
|
42
|
-
warb_from_setup.document.dispatch(recipient_number, link: document_link, caption:
|
|
41
|
+
warb_from_setup.document.dispatch(recipient_number, link: document_link, filename: "optional_name.pdf")
|
|
42
|
+
warb_from_setup.document.dispatch(recipient_number, link: document_link, caption: "OPTIONAL - Document caption")
|
|
43
43
|
|
|
44
44
|
warb_from_setup.document.dispatch(recipient_number) do |builder|
|
|
45
45
|
builder.media_id = document_id
|
|
46
|
-
builder.filename =
|
|
47
|
-
builder.caption =
|
|
46
|
+
builder.filename = "optional_name.pdf"
|
|
47
|
+
builder.caption = "OPTIONAL - Document caption"
|
|
48
48
|
end
|
|
49
49
|
|
|
50
50
|
warb_from_setup.document.dispatch(recipient_number) do |builder|
|
|
51
51
|
builder.link = document_link
|
|
52
|
-
builder.filename =
|
|
53
|
-
builder.caption =
|
|
52
|
+
builder.filename = "optional_name.pdf"
|
|
53
|
+
builder.caption = "OPTIONAL - Document caption"
|
|
54
54
|
end
|
|
55
55
|
|
|
56
56
|
# ############################################ #
|
|
@@ -64,8 +64,8 @@ warb_from_new = Warb.new(
|
|
|
64
64
|
)
|
|
65
65
|
|
|
66
66
|
# Same as stated above, if you need a document id, you can upload it this way
|
|
67
|
-
file_path =
|
|
68
|
-
file_type =
|
|
67
|
+
file_path = "" # fill this in with the file path pointing to wherever the document is located
|
|
68
|
+
file_type = "" # fill this in with the mimetype of the document to be uploaded
|
|
69
69
|
# allow values for file_type:
|
|
70
70
|
# text/plain, application/vnd.ms-excel, application/msword
|
|
71
71
|
# application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-powerpoint,
|
|
@@ -74,22 +74,22 @@ document_id = warb_from_setup.document.upload(file_path: file_path, file_type: f
|
|
|
74
74
|
# if you already have a document id, you can simply replace the above line with such id
|
|
75
75
|
|
|
76
76
|
warb_from_new.document.dispatch(recipient_number, media_id: document_id)
|
|
77
|
-
warb_from_new.document.dispatch(recipient_number, media_id: document_id, filename:
|
|
78
|
-
warb_from_new.document.dispatch(recipient_number, media_id: document_id, caption:
|
|
77
|
+
warb_from_new.document.dispatch(recipient_number, media_id: document_id, filename: "optional_name.pdf")
|
|
78
|
+
warb_from_new.document.dispatch(recipient_number, media_id: document_id, caption: "OPTIONAL - Document caption")
|
|
79
79
|
warb_from_new.document.dispatch(recipient_number, link: document_link)
|
|
80
|
-
warb_from_new.document.dispatch(recipient_number, link: document_link, filename:
|
|
81
|
-
warb_from_new.document.dispatch(recipient_number, link: document_link, caption:
|
|
80
|
+
warb_from_new.document.dispatch(recipient_number, link: document_link, filename: "optional_name.pdf")
|
|
81
|
+
warb_from_new.document.dispatch(recipient_number, link: document_link, caption: "OPTIONAL - Document caption")
|
|
82
82
|
|
|
83
83
|
warb_from_new.document.dispatch(recipient_number) do |builder|
|
|
84
84
|
builder.media_id = document_id
|
|
85
|
-
builder.filename =
|
|
86
|
-
builder.caption =
|
|
85
|
+
builder.filename = "optional_name.pdf"
|
|
86
|
+
builder.caption = "OPTIONAL - Document caption"
|
|
87
87
|
end
|
|
88
88
|
|
|
89
89
|
warb_from_new.document.dispatch(recipient_number) do |builder|
|
|
90
90
|
builder.link = document_link
|
|
91
|
-
builder.filename =
|
|
92
|
-
builder.caption =
|
|
91
|
+
builder.filename = "optional_name.pdf"
|
|
92
|
+
builder.caption = "OPTIONAL - Document caption"
|
|
93
93
|
end
|
|
94
94
|
|
|
95
95
|
# ################################################# #
|
|
@@ -97,20 +97,20 @@ end
|
|
|
97
97
|
# ################################################# #
|
|
98
98
|
|
|
99
99
|
Warb.document.dispatch(recipient_number, media_id: document_id)
|
|
100
|
-
Warb.document.dispatch(recipient_number, media_id: document_id, filename:
|
|
101
|
-
Warb.document.dispatch(recipient_number, media_id: document_id, caption:
|
|
100
|
+
Warb.document.dispatch(recipient_number, media_id: document_id, filename: "optional_name.pdf")
|
|
101
|
+
Warb.document.dispatch(recipient_number, media_id: document_id, caption: "OPTIONAL - Document caption")
|
|
102
102
|
Warb.document.dispatch(recipient_number, link: document_link)
|
|
103
|
-
Warb.document.dispatch(recipient_number, link: document_link, filename:
|
|
104
|
-
Warb.document.dispatch(recipient_number, link: document_link, caption:
|
|
103
|
+
Warb.document.dispatch(recipient_number, link: document_link, filename: "optional_name.pdf")
|
|
104
|
+
Warb.document.dispatch(recipient_number, link: document_link, caption: "OPTIONAL - Document caption")
|
|
105
105
|
|
|
106
106
|
Warb.document.dispatch(recipient_number) do |builder|
|
|
107
107
|
builder.media_id = document_id
|
|
108
|
-
builder.filename =
|
|
109
|
-
builder.caption =
|
|
108
|
+
builder.filename = "optional_name.pdf"
|
|
109
|
+
builder.caption = "OPTIONAL - Document caption"
|
|
110
110
|
end
|
|
111
111
|
|
|
112
112
|
Warb.document.dispatch(recipient_number) do |builder|
|
|
113
113
|
builder.link = document_link
|
|
114
|
-
builder.filename =
|
|
115
|
-
builder.caption =
|
|
114
|
+
builder.filename = "optional_name.pdf"
|
|
115
|
+
builder.caption = "OPTIONAL - Document caption"
|
|
116
116
|
end
|
data/examples/image.rb
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
require_relative
|
|
3
|
+
require_relative "../lib/warb"
|
|
4
4
|
|
|
5
5
|
# Configure your variables here
|
|
6
6
|
|
|
7
|
-
access_token =
|
|
8
|
-
business_id =
|
|
9
|
-
sender_id =
|
|
10
|
-
recipient_number =
|
|
7
|
+
access_token = ""
|
|
8
|
+
business_id = ""
|
|
9
|
+
sender_id = ""
|
|
10
|
+
recipient_number = ""
|
|
11
11
|
|
|
12
|
-
image_link =
|
|
12
|
+
image_link = ""
|
|
13
13
|
|
|
14
14
|
# We recommend testing one section at a time, as it can be overwhelming to see all the messages at once.
|
|
15
15
|
# So you can comment out the sections you don't want to test.
|
|
@@ -25,25 +25,25 @@ warb_from_setup = Warb.setup do |config|
|
|
|
25
25
|
end
|
|
26
26
|
|
|
27
27
|
warb_from_setup.image.dispatch(recipient_number, link: image_link)
|
|
28
|
-
warb_from_setup.image.dispatch(recipient_number, link: image_link, caption:
|
|
28
|
+
warb_from_setup.image.dispatch(recipient_number, link: image_link, caption: "OPTIONAL - Image caption")
|
|
29
29
|
|
|
30
30
|
# To send image using its ID, you may need to retrieve it first, which can be retrieved this way
|
|
31
|
-
file_path =
|
|
32
|
-
file_type =
|
|
31
|
+
file_path = "" # fill this in with the file path pointing to wherever the image is located
|
|
32
|
+
file_type = "" # fill this in with the mimetype of the image to be uploaded. allowed values: "image/jpeg" or "image/png"
|
|
33
33
|
image_id = warb_from_setup.image.upload(file_path: file_path, file_type: file_type)
|
|
34
34
|
# if you already have an image id, you can simply replace the above line with such id
|
|
35
35
|
|
|
36
36
|
warb_from_setup.image.dispatch(recipient_number, media_id: image_id)
|
|
37
|
-
warb_from_setup.image.dispatch(recipient_number, media_id: image_id, caption:
|
|
37
|
+
warb_from_setup.image.dispatch(recipient_number, media_id: image_id, caption: "OPTIONAL - Image caption")
|
|
38
38
|
|
|
39
39
|
warb_from_setup.image.dispatch(recipient_number) do |builder|
|
|
40
40
|
builder.media_id = image_id
|
|
41
|
-
builder.caption =
|
|
41
|
+
builder.caption = "OPTIONAL - Image caption"
|
|
42
42
|
end
|
|
43
43
|
|
|
44
44
|
warb_from_setup.image.dispatch(recipient_number) do |builder|
|
|
45
45
|
builder.link = image_link
|
|
46
|
-
builder.caption =
|
|
46
|
+
builder.caption = "OPTIONAL - Image caption"
|
|
47
47
|
end
|
|
48
48
|
|
|
49
49
|
# ############################################ #
|
|
@@ -57,24 +57,24 @@ warb_from_new = Warb.new(
|
|
|
57
57
|
)
|
|
58
58
|
|
|
59
59
|
# Same as stated above, if you need an image id, you can upload it this way
|
|
60
|
-
file_path =
|
|
61
|
-
file_type =
|
|
60
|
+
file_path = "" # fill this in with the file path pointing to wherever the image is located
|
|
61
|
+
file_type = "" # fill this in with the mimetype of the image to be uploaded. allowed values: "image/jpeg" or "image/png"
|
|
62
62
|
image_id = warb_from_new.image.upload(file_path: file_path, file_type: file_type)
|
|
63
63
|
# if you already have an image id, you can simply replace the above line with such id
|
|
64
64
|
|
|
65
65
|
warb_from_new.image.dispatch(recipient_number, media_id: image_id)
|
|
66
|
-
warb_from_new.image.dispatch(recipient_number, media_id: image_id, caption:
|
|
66
|
+
warb_from_new.image.dispatch(recipient_number, media_id: image_id, caption: "OPTIONAL - Image caption")
|
|
67
67
|
warb_from_new.image.dispatch(recipient_number, link: image_link)
|
|
68
|
-
warb_from_new.image.dispatch(recipient_number, link: image_link, caption:
|
|
68
|
+
warb_from_new.image.dispatch(recipient_number, link: image_link, caption: "OPTIONAL - Image caption")
|
|
69
69
|
|
|
70
70
|
warb_from_new.image.dispatch(recipient_number) do |builder|
|
|
71
71
|
builder.media_id = image_id
|
|
72
|
-
builder.caption =
|
|
72
|
+
builder.caption = "OPTIONAL - Image caption"
|
|
73
73
|
end
|
|
74
74
|
|
|
75
75
|
warb_from_new.image.dispatch(recipient_number) do |builder|
|
|
76
76
|
builder.link = image_link
|
|
77
|
-
builder.caption =
|
|
77
|
+
builder.caption = "OPTIONAL - Image caption"
|
|
78
78
|
end
|
|
79
79
|
|
|
80
80
|
# ################################################# #
|
|
@@ -82,16 +82,16 @@ end
|
|
|
82
82
|
# ################################################# #
|
|
83
83
|
|
|
84
84
|
Warb.image.dispatch(recipient_number, media_id: image_id)
|
|
85
|
-
Warb.image.dispatch(recipient_number, media_id: image_id, caption:
|
|
85
|
+
Warb.image.dispatch(recipient_number, media_id: image_id, caption: "OPTIONAL - Image caption")
|
|
86
86
|
Warb.image.dispatch(recipient_number, link: image_link)
|
|
87
|
-
Warb.image.dispatch(recipient_number, link: image_link, caption:
|
|
87
|
+
Warb.image.dispatch(recipient_number, link: image_link, caption: "OPTIONAL - Image caption")
|
|
88
88
|
|
|
89
89
|
Warb.image.dispatch(recipient_number) do |builder|
|
|
90
90
|
builder.media_id = image_id
|
|
91
|
-
builder.caption =
|
|
91
|
+
builder.caption = "OPTIONAL - Image caption"
|
|
92
92
|
end
|
|
93
93
|
|
|
94
94
|
Warb.image.dispatch(recipient_number) do |builder|
|
|
95
95
|
builder.link = image_link
|
|
96
|
-
builder.caption =
|
|
96
|
+
builder.caption = "OPTIONAL - Image caption"
|
|
97
97
|
end
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
require_relative
|
|
3
|
+
require_relative "../lib/warb"
|
|
4
4
|
|
|
5
5
|
# Configure your variables here
|
|
6
6
|
|
|
7
|
-
access_token =
|
|
8
|
-
business_id =
|
|
9
|
-
sender_id =
|
|
10
|
-
recipient_number =
|
|
7
|
+
access_token = ""
|
|
8
|
+
business_id = ""
|
|
9
|
+
sender_id = ""
|
|
10
|
+
recipient_number = ""
|
|
11
11
|
|
|
12
12
|
# You can use Resources to create headers for your messages.
|
|
13
|
-
text_header = Warb::Resources::Text.as_header(
|
|
13
|
+
text_header = Warb::Resources::Text.as_header("OPTIONAL - Header")
|
|
14
14
|
image_header = Warb::Resources::Image.as_header(media_id: image_id)
|
|
15
15
|
video_header = Warb::Resources::Video.as_header(link: image_url)
|
|
16
16
|
|
|
17
17
|
# You can use Action Components to create actions for your messages.
|
|
18
|
-
action_component = Warb::Components::CTAAction.new(button_text:
|
|
18
|
+
action_component = Warb::Components::CTAAction.new(button_text: "Action button text", url: "https://www.rebase.com.br")
|
|
19
19
|
|
|
20
20
|
# We recommend testing one section at a time, as it can be overwhelming to see all the messages at once.
|
|
21
21
|
# So you can comment out the sections you don't want to test.
|
|
@@ -33,44 +33,44 @@ end
|
|
|
33
33
|
warb_from_setup.interactive_call_to_action_url.dispatch(
|
|
34
34
|
recipient_number,
|
|
35
35
|
header: text_header,
|
|
36
|
-
body:
|
|
37
|
-
footer:
|
|
36
|
+
body: "body",
|
|
37
|
+
footer: "footer",
|
|
38
38
|
action: action_component
|
|
39
39
|
)
|
|
40
40
|
|
|
41
41
|
warb_from_setup.interactive_call_to_action_url.dispatch(
|
|
42
42
|
recipient_number,
|
|
43
43
|
header: image_header,
|
|
44
|
-
body:
|
|
45
|
-
footer:
|
|
44
|
+
body: "body",
|
|
45
|
+
footer: "footer",
|
|
46
46
|
action: action_component
|
|
47
47
|
)
|
|
48
48
|
|
|
49
49
|
warb_from_setup.interactive_call_to_action_url.dispatch(
|
|
50
50
|
recipient_number,
|
|
51
51
|
header: video_header,
|
|
52
|
-
body:
|
|
53
|
-
footer:
|
|
52
|
+
body: "body",
|
|
53
|
+
footer: "footer",
|
|
54
54
|
action: action_component
|
|
55
55
|
)
|
|
56
56
|
|
|
57
57
|
warb_from_setup.interactive_call_to_action_url.dispatch(recipient_number) do |builder|
|
|
58
58
|
# OPTIONAL Headers: you can choose between text, image, or video headers.
|
|
59
59
|
|
|
60
|
-
builder.
|
|
60
|
+
builder.set_text_header("Text Header")
|
|
61
61
|
|
|
62
62
|
# If you want to use an image header, uncomment the line below and provide a valid or Media ID or Link.
|
|
63
|
-
# builder.
|
|
63
|
+
# builder.set_image_header(media_id: image_id) # or builder.set_image_header(link: image_link)
|
|
64
64
|
|
|
65
65
|
# If you want to use a video header, uncomment the line below and provide a valid Media ID or Link.
|
|
66
|
-
# builder.
|
|
66
|
+
# builder.set_video_header(media_id: video_id) # or builder.set_video_header(link: video_link)
|
|
67
67
|
|
|
68
|
-
builder.body =
|
|
69
|
-
builder.footer =
|
|
68
|
+
builder.body = "body"
|
|
69
|
+
builder.footer = "footer"
|
|
70
70
|
|
|
71
71
|
builder.build_action do |action|
|
|
72
|
-
action.button_text =
|
|
73
|
-
action.url =
|
|
72
|
+
action.button_text = "Action Button Text"
|
|
73
|
+
action.url = "https://www.rebase.com.br"
|
|
74
74
|
end
|
|
75
75
|
end
|
|
76
76
|
|
|
@@ -87,44 +87,44 @@ warb_from_new = Warb.new(
|
|
|
87
87
|
warb_from_new.interactive_call_to_action_url.dispatch(
|
|
88
88
|
recipient_number,
|
|
89
89
|
header: text_header,
|
|
90
|
-
body:
|
|
91
|
-
footer:
|
|
90
|
+
body: "body",
|
|
91
|
+
footer: "footer",
|
|
92
92
|
action: action_component
|
|
93
93
|
)
|
|
94
94
|
|
|
95
95
|
warb_from_new.interactive_call_to_action_url.dispatch(
|
|
96
96
|
recipient_number,
|
|
97
97
|
header: image_header,
|
|
98
|
-
body:
|
|
99
|
-
footer:
|
|
98
|
+
body: "body",
|
|
99
|
+
footer: "footer",
|
|
100
100
|
action: action_component
|
|
101
101
|
)
|
|
102
102
|
|
|
103
103
|
warb_from_new.interactive_call_to_action_url.dispatch(
|
|
104
104
|
recipient_number,
|
|
105
105
|
header: video_header,
|
|
106
|
-
body:
|
|
107
|
-
footer:
|
|
106
|
+
body: "body",
|
|
107
|
+
footer: "footer",
|
|
108
108
|
action: action_component
|
|
109
109
|
)
|
|
110
110
|
|
|
111
111
|
warb_from_new.interactive_call_to_action_url.dispatch(recipient_number) do |builder|
|
|
112
112
|
# Headers: you can choose between text, image, or video headers.
|
|
113
113
|
|
|
114
|
-
builder.
|
|
114
|
+
builder.set_text_header("Text Header")
|
|
115
115
|
|
|
116
116
|
# If you want to use an image header, uncomment the line below and provide a valid or Media ID or Link.
|
|
117
|
-
# builder.
|
|
117
|
+
# builder.set_image_header(media_id: image_id) # or builder.set_image_header(link: image_link)
|
|
118
118
|
|
|
119
119
|
# If you want to use a video header, uncomment the line below and provide a valid Media ID or Link.
|
|
120
|
-
# builder.
|
|
120
|
+
# builder.set_video_header(media_id: video_id) # or builder.set_video_header(link: video_link)
|
|
121
121
|
|
|
122
|
-
builder.body =
|
|
123
|
-
builder.footer =
|
|
122
|
+
builder.body = "body"
|
|
123
|
+
builder.footer = "footer"
|
|
124
124
|
|
|
125
125
|
builder.build_action do |action|
|
|
126
|
-
action.button_text =
|
|
127
|
-
action.url =
|
|
126
|
+
action.button_text = "Action Button Text"
|
|
127
|
+
action.url = "https://www.rebase.com.br"
|
|
128
128
|
end
|
|
129
129
|
end
|
|
130
130
|
|
|
@@ -135,43 +135,43 @@ end
|
|
|
135
135
|
Warb.interactive_call_to_action_url.dispatch(
|
|
136
136
|
recipient_number,
|
|
137
137
|
header: text_header,
|
|
138
|
-
body:
|
|
139
|
-
footer:
|
|
138
|
+
body: "body",
|
|
139
|
+
footer: "footer",
|
|
140
140
|
action: action_component
|
|
141
141
|
)
|
|
142
142
|
|
|
143
143
|
Warb.interactive_call_to_action_url.dispatch(
|
|
144
144
|
recipient_number,
|
|
145
145
|
header: image_header,
|
|
146
|
-
body:
|
|
147
|
-
footer:
|
|
146
|
+
body: "body",
|
|
147
|
+
footer: "footer",
|
|
148
148
|
action: action_component
|
|
149
149
|
)
|
|
150
150
|
|
|
151
151
|
Warb.interactive_call_to_action_url.dispatch(
|
|
152
152
|
recipient_number,
|
|
153
153
|
header: video_header,
|
|
154
|
-
body:
|
|
155
|
-
footer:
|
|
154
|
+
body: "body",
|
|
155
|
+
footer: "footer",
|
|
156
156
|
action: action_component
|
|
157
157
|
)
|
|
158
158
|
|
|
159
159
|
Warb.interactive_call_to_action_url.dispatch(recipient_number) do |builder|
|
|
160
160
|
# Headers: you can choose between text, image, or video headers.
|
|
161
161
|
|
|
162
|
-
builder.
|
|
162
|
+
builder.set_text_header("Text Header")
|
|
163
163
|
|
|
164
164
|
# If you want to use an image header, uncomment the line below and provide a valid or Media ID or Link.
|
|
165
|
-
# builder.
|
|
165
|
+
# builder.set_image_header(media_id: image_id) # or builder.set_image_header(link: image_link)
|
|
166
166
|
|
|
167
167
|
# If you want to use a video header, uncomment the line below and provide a valid Media ID or Link.
|
|
168
|
-
# builder.
|
|
168
|
+
# builder.set_video_header(media_id: video_id) # or builder.set_video_header(link: video_link)
|
|
169
169
|
|
|
170
|
-
builder.body =
|
|
171
|
-
builder.footer =
|
|
170
|
+
builder.body = "body"
|
|
171
|
+
builder.footer = "footer"
|
|
172
172
|
|
|
173
173
|
builder.build_action do |action|
|
|
174
|
-
action.button_text =
|
|
175
|
-
action.url =
|
|
174
|
+
action.button_text = "Action Button Text"
|
|
175
|
+
action.url = "https://www.rebase.com.br"
|
|
176
176
|
end
|
|
177
177
|
end
|