Skip to content

Commit 86741c2

Browse files
committed
Switch to SendTemplateAsync instead
1 parent 604cffc commit 86741c2

File tree

1 file changed

+20
-29
lines changed

1 file changed

+20
-29
lines changed

src/Tests/WhatsAppClientTests.cs

Lines changed: 20 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -165,40 +165,31 @@ public async Task SendsTemplateAsync()
165165
{
166166
var (configuration, client) = Initialize();
167167

168-
// Send an interactive message with three buttons showcasing the payload/value
169-
// being different than the button text
170-
await client.SendAsync(configuration["SendFrom"]!, new
168+
await client.SendTemplateAsync(configuration["SendFrom"]!, configuration["SendTo"]!, new
171169
{
172-
messaging_product = "whatsapp",
173-
recipient_type = "individual",
174-
to = configuration["SendTo"]!,
175-
type = "template",
176-
template = new
170+
name = "reminder",
171+
language = new
177172
{
178-
name = "reminder",
179-
language = new
180-
{
181-
code = "es"
182-
},
183-
components = new[]
173+
code = "es"
174+
},
175+
components = new[]
176+
{
177+
new
184178
{
185-
new
179+
type = "body",
180+
parameters = new[]
186181
{
187-
type = "body",
188-
parameters = new[]
182+
new
183+
{
184+
type = "text",
185+
parameter_name = "reminder_text",
186+
text = "Dentista"
187+
},
188+
new
189189
{
190-
new
191-
{
192-
type = "text",
193-
parameter_name = "reminder_text",
194-
text = "Dentista"
195-
},
196-
new
197-
{
198-
type = "text",
199-
parameter_name = "reminder_datetime",
200-
text = "3pm"
201-
}
190+
type = "text",
191+
parameter_name = "reminder_datetime",
192+
text = "3pm"
202193
}
203194
}
204195
}

0 commit comments

Comments
 (0)