Skip to content

campaign_timeline_opened_week ​

php
array|boolean campaign_timeline_opened_week ( number $campaignId )

Returns open counts by day of the week for the campaign whose ID is supplied as the parameter. Returns false if the campaign ID does not exist.

Example:

php
$campaingId = 1;

print("Opens in campaign ". $campaingId.":\n");
$data = campaign_timeline_opened_week($campaingId);

if (empty($data)) {
print("no opens recorded yet");
exit();
}

$weekConstants = explode(",",registry_get('WEEK_CONSTANTS'));
$len = count($data)-1;
for ($i = 0 to $len) {
$openedAmount = $data[$i];
if ($openedAmount > 0) {
print($weekConstants[$i]." ".$openedAmount."\n");
}
}

The "WEEK_CONSTANTS" registry entry contains comma-separated names of the days of the week. The result will look similar to:

Opens in campaign 1:
MONDAY 3
WEDNESDAY 6
FRIDAY 4