mailbuild - php - Subscriber.AddWithCustomFields - help?

I've managed to get the Subscriber.Add php sample, subscribeMBPHP5.php, to work correctly, however, I have no idea how to modify it to work with Subscriber.AddWithCustomFields

//make soap call
    $result = $client->__soapCall(
                                    "Subscriber.AddWithCustomFields",
                                    array(    new SoapVar("xxxxxxxxxx", XSD_STRING, null, null, "ApiKey","http://api.createsend.com/api/"),
                                        new SoapVar("xxxxxxxxxx", XSD_STRING, null, null, "ListID","http://api.createsend.com/api/"),
                                        new SoapVar("mail@mail.com", XSD_STRING, null, null, "Email","http://api.createsend.com/api/"),
                                        new SoapVar("Mat", XSD_STRING, null, null, "Name","http://api.createsend.com/api/"),
                                        new SoapVar("Mr", XSD_STRING, null, null, "title","http://api.createsend.com/api/"),
                                        new SoapVar("Thingy Wotzit", XSD_STRING, null, null, "buildingname","http://api.createsend.com/api/"),
                                        new SoapVar("Wobbleton", XSD_STRING, null, null, "locality","http://api.createsend.com/api/"),
                                        new SoapVar("Newfoundland", XSD_STRING, null, null, "posttown","http://api.createsend.com/api/"),
                                        new SoapVar("BP1232", XSD_STRING, null, null, "postcode","http://api.createsend.com/api/")
                                    )                                        
                                    ,
                                    array(
                                        "soapaction"    => "http://api.createsend.com/api/Subscriber.AddWithCustomFields"
                                    )
                                    
                                );

Basically, everything after

new SoapVar("Mat", XSD_STRING, null, null, "Name","http://api.createsend.com/api/")

isn't added to my list, as obviously the system doesn't have a clue that these are custom form fields.

Any help would be much appreciated.

Jason Jason, 8 years ago

Hi Matt,

We'll be looking at expanding on the MailBuild documentation soon to cover this method call, but in the meantime the resources covering this at campaign monitor should get you going in the right direction. The code will be extremely similar, with just the substitution of the service endpoint and namespace to the MailBuild equivalents required.

If you run into any issues, get in touch with support like you have with this initially, and we'll be more than happy to help.

bb_matt, 8 years ago

Does that mean that currently, all the calls that are within campaign monitor, are available in mailbuild?

If so, a list would be extremely handy!

Join 200,000 companies around the world that use Campaign Monitor to run email marketing campaigns that deliver results for their business.

Get started for free
1-888-533-8098