Closed murugapandiyan closed 1 year ago
Please provide an example of your code.
Thanks.
//$whatsapp_cloud_api->sendTextMessage('91'.$mobile_no, 'Hi '.$name.', // //You are login successfully on Damooga Foundation. If you cannot perform login now, kindly information to @.*** // //Thanks // //Support Team //Damooga Foundation');
$name_1 = 'muruga' ;
$donation_amount = '150';
$payment_ref_no = '154785' ;
$mobile_no_1 = '91'.'9944191122';
//$component_header = [];
use Netflie\WhatsAppCloudApi\Message\Template\Component;
use Netflie\WhatsAppCloudApi\Message\Media\LinkID; use Netflie\WhatsAppCloudApi\Message\Media\MediaObjectID;
$component_header = [ [ 'type' => 'document', 'document' => 'https://dfngo.org/vendor/pan_card.pdf', ], ];
$component_body = [ [ 'type' => 'text', 'text' => $name_1, ], [ 'type' => 'text', 'text' => $donation_amount, ], [ 'type' => 'text', 'text' => $payment_ref_no, ], ];
$document_id = '341476474779872'; $document_name = 'pan_card.pdf'; $document_caption = 'WhastApp API Cloud Guide';
$components = new Component($component_header, $component_body); $whatsapp_cloud_api->sendTemplate($mobile_no_1, 'sample_flight_confirmation', 'en_US', $components); // Language is optional
Thanks & Ragrds
muruga
Message ID: @.***>
Hi @murugapandiyan
You're building wrong the header component for the document url. Please check the official guide: https://developers.facebook.com/docs/whatsapp/cloud-api/guides/send-message-templates#interactive
Best regards.
i try to send whatsapp template like header "documents" body
"string text"
not working your code.
kindly let me know how to send message thorugh whatsapp template media with body content.