Silverpop XML API – Send email on website form – tutorial

Image

This tutorial describes how to automatize email send (after for example a form website compilation) with SilverPOP XML Api and php.

The first step is performed in SilverPop and requires the creation of a Silverpop database (that will store form information), and an autoresponder (based on a specific template).

First step: You login in Silverpop to create your database (single opt-in database)

pic2

pic3

Then you can create your custom fields in the database (based on the form fields you have in your website).

pic4 pic5

In our example (above) we have created the additional fields: firstname, familyname, code.

Now we can create the template for the mail that will be automatically send to our website users (that will fill our form). Once the template is created you have to select Automate to create an automated message.

The Automated message will be sent every time a new user is added to your database (with the custom fields created).

pic6 pic7

Do not forget to:

  • create a name for your automated message (Mailing Name)
  • associate the automated message to your database (Custom Source)
  • Select the option “Opt In” for Autoresponder setup

pic8 pic9

Once completed you can submit and create your automated message.

pic10

The database fields will be replaced inside your template for all the element created in the form of %%value%%. In our case we will include in our template

Dear %%firstname%% %%familyname%%

When the autoresponder will be automatically send, upon database user insertion, these fields will be replaced automatically.

Please keep in mind, Silverpop could inform you about any errors between database fields and your template after the automation created have been submitted (see screenshot below)

pic11

From the coding part (PHP) we will use again EngagePod API as described in our previous articles.

We need to login first and with the id of the database (you can find on SilverPop passing your mouse over the Database name) you can insert your entry based on the information received from the form (in our case firstname, familyname, code).

The example in the code below:

 

Facebooktwitterredditpinterestlinkedinmail

Silverpop createQuery example

In order to create a query you have to create or retrieve the id of the object (a database) you want to query from.

Considering you have created a $silverpop (new EngagePod) with login credentials and server number (https://ictknowledge.net/engagepod-php-php-library-silverpop/);
You can use GetList call to extract a list of databases

Then you can pass the query to your database, the following example returns all the lines with the email address equal to the one given:

retrieve_adr is the name of the query that will be created
$list_id is the variable where the database id is stored

Facebooktwitterredditpinterestlinkedinmail

EngagePod php – Silverpop PHP Client Library

EngagePod.php is a PHP client library for the Silverpop API
Most of the examples and tutorial in this section will make use of this library

Library and info at:
https://github.com/simpleweb/SilverpopPHP

first thing to use silverpop API calls is to login with your credentials
EgangePod.php helps us with the following function

Facebooktwitterredditpinterestlinkedinmail