pRieStaKos Posted November 8, 2016 Share Posted November 8, 2016 Hello, I'm trying to make a hook and I got an issue with a foreach function. I got the following error, but I'm using the smarty foreach function from http://docs.whmcs.com/Email_Templates. // Call WHMCS API - send admin email $command = "sendadminemail"; $adminuser = "admin"; $values["customsubject"] = "Daily Cron Report"; $values["custommessage"] = "Domains Report<br>"; $values["custommessage"] .= "--------------------<br>"; $values["custommessage"] .= "{$active_domains_count} Active Domains<br>{$expired_domains_count} Expired Domains<br>"; $values["custommessage"] .= "--------------------<br>"; $values["custommessage"] .= "Expired Domains"; $values["custommessage"] .= "{foreach from=$expired_domains item=expireddomains}-{$expireddomains.domain}<br>{/foreach}"; $values["customvars"] = array("active_domains_count" => $active_domains_count, "expired_domains_count" => $expired_domains_count, "expired_domains" => $expired_domains); $values["type"] = "system"; $results = localAPI($command, $values, $adminuser); Parse error: syntax error, unexpected '.', expecting '}' in /includes/hooks/dailycron.php on line 24 Any suggestions ? 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.