Jump to content

SendAdminEmail API - Send array to mergefields


Nullified

Recommended Posts

I am trying to pass an array to mergefield data. Is this possible?

 

My Script:

$postfields["username"] = 'username';
$postfields["password"] = md5('password');
$postfields["action"] = "SendAdminEmail";
$postfields["messagename"] = "Domain Synchronization Report";
$postfields["mergefields[dtg]"] = date("j F Y @ G:i:s");
$postfields["mergefields[exemptions]"] = $exemptions;

 

$exemptions is either blank or an array of data.

 

My messagename Admin Template:

Domain Pricing Synchronization Cron Report for {$dtg}

{if is_array($exemptions)}Domain Pricing Exemptions:
{foreach from=$exemptions key=k item=v}
{if $k.register} - $k registrations have been exempted from auto update.{/if}
{if $k.transfer} - $k transfers have been exempted from auto update.{/if}
{if $k.renew} - $k renewals have been exempted from auto update.{/if}
{/foreach}
{/if}

Domain Pricing Synchronization Complete

 

$dtg sends the date through the email just fine, but the array data for $exemptions (and the other arrays) is gone. I have tested the $postfields[mergefields[*]] variables for valid array data and they are fine in the script. They are however lost once sent to the WHMCS API.

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