|
@ -103,8 +103,33 @@ export class HomeComponent { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
console.log(this.arrayToBeSend); |
|
|
console.log(this.arrayToBeSend); |
|
|
|
|
|
const phoneNumber: any = []; |
|
|
|
|
|
for (let i = 0; i < this.arrayToBeSend.length; i++) { |
|
|
|
|
|
console.log(this.arrayToBeSend[i]['PHONE NUMBER']); |
|
|
|
|
|
phoneNumber.push(this.arrayToBeSend[i]['PHONE NUMBER']); |
|
|
|
|
|
} |
|
|
|
|
|
console.log(phoneNumber); |
|
|
|
|
|
const body = { |
|
|
|
|
|
messages: [ |
|
|
|
|
|
{ |
|
|
|
|
|
from: '447491163530', |
|
|
|
|
|
to: phoneNumber, |
|
|
|
|
|
messageId: 'a28dd97c-1ffb-4fcf-99f1-0b557ed381da', |
|
|
|
|
|
content: { |
|
|
|
|
|
templateName: 'infobip_kz_test_hsm_2', |
|
|
|
|
|
templateData: { |
|
|
|
|
|
body: { |
|
|
|
|
|
placeholders: ['BFL Credit Card'], |
|
|
|
|
|
}, |
|
|
|
|
|
}, |
|
|
|
|
|
language: 'en_GB', |
|
|
|
|
|
}, |
|
|
|
|
|
callbackData: 'Callback data', |
|
|
|
|
|
}, |
|
|
|
|
|
], |
|
|
|
|
|
}; |
|
|
this.subscriptions.push( |
|
|
this.subscriptions.push( |
|
|
this.homeService.sendWhatsApp(this.arrayToBeSend).subscribe( |
|
|
|
|
|
|
|
|
this.homeService.sendWhatsApp(body).subscribe( |
|
|
(res) => { |
|
|
(res) => { |
|
|
console.log(res); |
|
|
console.log(res); |
|
|
}, |
|
|
}, |
|
|