1973 Ltd

Email dispatch from Eloqua using the REST API (Eloqua 10).

By on April 29th In Development, Email marketing
Eloqua 10 API montage

Sending emails using the Eloqua API, updated for Eloqua 10.

To follow on from my last post, we’ve now been sending out CC’d emails using Eloqua 10, and it’s been a straightforward changeover, with only a couple of alterations to our code.

I think the simplest way to illustrate this is to just update the previous code, so…

Firstly, we establish connection to our Eloqua instance, using our normal login credentials.

We define and initialise three objects to hold our data.

Initialise two of the objects, then later we initiliase the deployment object for each individual send.

So now the email can be assembled in HTML using PHP based on our requirements for the current contact, and saved as a variable called $email_content. All images would be remotely linked but URL’s can go in normally, eg https://community.oracle.com/community/topliners/ but with the additional querystring ‘?elqtrack=true’ appended to them and they will be tracked using the setting ‘isTracked’ as below. So an url would be like :

http://www.google.co.uk?elqtrack=true

We then put it together in the objects.

A lot of the ID’s for groups, folders etc are now hidden in Eloqua 10, so I have written a couple of scripts that will list them all which you can see here.

It’s important to return a response at this point even if you don’t write it to screen because you need the newly created email’s ID. So after the response use the following to update your email object with the new ID :

The email has now been created in Eloqua and the email object contains all thats needed to use in the deployment (the previous email settings like footer, header etc won’t affect the deployment now the email has been created so they can be left in).

To send it to someone, you need to have the users Eloqua contact ID (you can’t just send to an email, they need to be an existing subscribed contact).

We have a script here that looks up users contact ID’s based on their email, but for simplicity we’ll just assume that its an individual with the contact ID ‘CSEAT000012345678’. Before you can do the send the ID needs to be formatted slightly differently, so just remove the ‘CSEAT’, and leave the rest.

Now we can add some variables into our deployment object.

For Eloqua 10, the above paragraph is the same but I’ve updated the ‘CSEAG’ prefix to match E10’s ‘CSEAT’.

Send it.

Your email has now been sent out as a quicksend to the first contact, so to send to the second :

A little bit of tidying up.

And thats it, a quite unusual problem solved again, this time in Eloqua 10.

Comments  -  0 Comments

There are no comments yet.

Follow our blog!

Recent Posts

Categories

Our latest tweets

Archives

Authors