# How can I populate WhatsApp template parameters with PHP?

**URL:** <https://community.brevo.com/t/how-can-i-populate-whatsapp-template-parameters-with-php/4012>\
**Category:** Transactional\
**Created:** [Mars 24, 2025, 2:47 UTC](https://community.brevo.com/t/how-can-i-populate-whatsapp-template-parameters-with-php/4012 "2025-03-24T14:47:19Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mburdett555](https://avatars.discourse-cdn.com/v4/letter/m/c57346/32.png) [@mburdett555](https://community.brevo.com/u/mburdett555)\
**Post date:** [Mars 24, 2025, 2:47 UTC](https://community.brevo.com/t/how-can-i-populate-whatsapp-template-parameters-with-php/4012/1 "2025-03-24T14:47:19Z")

</div>

Hello  
I am using this [Github Brevo Library](https://github.com/getbrevo/brevo-php/blob/main/docs/Model/SendWhatsappMessage.md) to send transactional emails and SMS. I would now like to use the WhatsApp feature.

I have gone through the WhatsApp setup process and am able to send messages successfully, but I am having trouble populating the parameters set out in my template.

I have created a parameter in my template: {{unitNumber}}

I run the following code which populates the number into an object with property «&nbsp;unitNumber&nbsp;»,

```auto
$params = new stdClass();
	$params->unitNumber = '357001';
	
	try {
		$sendWhatsappMessage["templateId"] = 8;
		$sendWhatsappMessage["senderNumber"] = "447870219640";
		$sendWhatsappMessage["contactNumbers"] = ["447843915605"];
		$sendWhatsappMessage["params"] = $params;

		$result = $wapInstance->sendWhatsappMessage($sendWhatsappMessage);
		print_r($result);
	} catch (Exception $e) {
		echo 'Exception when calling TransactionalWhatsAppApi->sendWhatsappMessage: ', $e->getMessage(), PHP_EOL;
	}

```

However when I send it, the message just shows the template field «&nbsp;{{unitNumber}}&nbsp;».

What am I doing wrong? I have tried several ways of adding the parameters, including defining it as an array etc array(«&nbsp;unitNumber&nbsp;» =\> «&nbsp;357001&nbsp;»); but it makes so difference…
