Forum Stats

  • 3,677,960 Users
  • 7,900 Discussions
  • 13,003 Comments

Discussions

Adjusting the subject line in an Email Deployment using the API

kevincassidy313
kevincassidy313 Posts: 32 Silver Badge
edited Sep 15, 2020 7:18PM in Developer Tools

Hi,

We have an internal tool that stakeholders use to build their emails in a drag-and-drop WYSIWYG interface.

One of the features of this tool is that it allows users to send themselves a test email (just like you would from within Eloqua itself).

When the API call is fired, the test email is sent successfully. It shows the actual subject line. What I would like to do is, mimic Eloqua's functionality where they put *TEST* before and after the subject line.

Does anybody know how to do this with the API?

Current state: Subject line is This is a test email

Ideal state: Subject line is * TEST * This is a test email * TEST *

This is the API endpoint I'm using: https://docs.oracle.com/en/cloud/saas/marketing/eloqua-rest-api/op-api-rest-2.0-assets-email-deployment-post.html 

And this is the body of my call:

var json = {

        "type": "EmailTestDeployment",

        "name": "Email Editor",

        "contactId": contactID,

        "email": {

          "type": "Email",

          "id": emailID,

          "name": emailName

        },

        "sendOptions": {

          "allowResend": "true",

          "allowSendToUnsubscribe": "true",

          "allowSendToGroupUnsubscribe": "true"

        }

      }

I've tried putting the parameter 'subject' inside the 'email' object but that didn't work. I also tried using the parameter 'sentSubject' but again, no effect - in both cases the original subject line was sent.

Any help would be greatly appreciated.

Thanks,
Kevin

Post edited by Unknown User on

Best Answer

  • Lou Patrick
    Lou Patrick Posts: 192 Gold Badge
    edited Sep 14, 2020 2:08PM Accepted Answer

    The TEST added by Eloqua only occurs via the test send in the Eloqua UI.

    Via the Email Deployment endpoint you are actually sending the email, and it's not possible to send a test email like you can in Eloqua, nor is it possible to adjust the subject line in this request, the subject line set on the email will always be used. If you want to add TEST to the subject line, you'd have to update the actual subject line on the email, which can be done via the Update an email API endpoint, before sending via the Email Deployment endpoint.

Answers