diff --git a/src/app/pages/home/home.component.ts b/src/app/pages/home/home.component.ts index e544649..6e0e401 100644 --- a/src/app/pages/home/home.component.ts +++ b/src/app/pages/home/home.component.ts @@ -103,8 +103,33 @@ export class HomeComponent { } } 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.homeService.sendWhatsApp(this.arrayToBeSend).subscribe( + this.homeService.sendWhatsApp(body).subscribe( (res) => { console.log(res); }, diff --git a/src/app/pages/home/home.service.ts b/src/app/pages/home/home.service.ts index d9c1040..087e98a 100644 --- a/src/app/pages/home/home.service.ts +++ b/src/app/pages/home/home.service.ts @@ -8,8 +8,8 @@ import { IHomeRequest, IHomeResponse } from '../../../app/model/home'; const httpOptions = { headers: new HttpHeaders({ 'Content-Type': 'application/json', - Authorization: - 'Basic 2b8cba9008e1da2f2733ff8300cf1973-dc928670-56f9-4a29-8725-69239d669e74', + authorization: + 'App 2b8cba9008e1da2f2733ff8300cf1973-dc928670-56f9-4a29-8725-69239d669e74', }), };