Jump to content

Hook - foreach error


pRieStaKos

Recommended Posts

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 ?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated