Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions docs/app.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ Create a new `SendWhatsAppRequest` object containing:

- `transactional_message_id`: the ID or trigger name of the transactional message you want to send.
- an `identifiers` object containing the `id` or `email` of your recipient. If the profile does not exist, Customer.io will create it.
- `to` and `from`: E.164-formatted phone numbers. Both are optional only when the referenced `transactional_message_id` already defines them.
- `to`: an E.164-formatted phone number. Optional only when the referenced `transactional_message_id` already defines it.

Use `sendWhatsApp` referencing your request to send a transactional message. [Learn more about transactional messages](https://customer.io/docs/transactional-api).

Expand All @@ -100,7 +100,6 @@ const api = new APIClient("app-key", { region: RegionUS });

const request = new SendWhatsAppRequest({
to: "+15558675309",
from: "+15551234567",
transactional_message_id: "3",
message_data: {
name: "Person",
Expand Down
2 changes: 0 additions & 2 deletions lib/api/requests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,6 @@ export type SendWhatsAppRequestRequiredOptions = {

export type SendWhatsAppRequestOptionalOptions = Partial<{
to: string;
from: string;
tracked: boolean;
disable_message_retention: boolean;
send_to_unsubscribed: boolean;
Expand All @@ -309,7 +308,6 @@ export type SendWhatsAppRequestOptions = SendWhatsAppRequestRequiredOptions & Se

const WHATSAPP_OPTIONAL_KEYS = [
'to',
'from',
'tracked',
'disable_message_retention',
'send_to_unsubscribed',
Expand Down
2 changes: 0 additions & 2 deletions test/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -678,7 +678,6 @@ test('#sendWhatsApp: with optional parameters: success', (t) => {
sinon.stub(t.context.client.request, 'post');
let req = new SendWhatsAppRequest({
to: '+1234567890',
from: '+1987654321',
identifiers: { id: '2' },
transactional_message_id: 1,
message_data: { key: 'value' },
Expand All @@ -693,7 +692,6 @@ test('#sendWhatsApp: with optional parameters: success', (t) => {
t.truthy((t.context.client.request.post as SinonStub).calledWith(`${RegionUS.apiUrl}/send/whatsapp`, req.message));
t.is(req.message.transactional_message_id, 1);
t.is(req.message.to, '+1234567890');
t.is(req.message.from, '+1987654321');
t.deepEqual(req.message.message_data, { key: 'value' });
t.true(req.message.tracked);
t.true(req.message.disable_message_retention);
Expand Down