Adjusting the subject line in an Email Deployment using the API

kevincassidy313 Posts: 5 Silver Medal
edited Sep 15, 2020 7:18PM in Developer Tools


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.


Post edited by Unknown User on

Best Answer

  • Lou Patrick
    Lou Patrick Posts: 194 Bronze Trophy
    edited Sep 14, 2020 2:08PM 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.


  • kevincassidy313
    kevincassidy313 Posts: 5 Silver Medal
    edited Sep 15, 2020 5:33AM

    Thanks Lou. I appreciate the response.

    Do you know if this functionality will be added in the future - I assume the old 'Send Test Email' is eventually going to be upgraded to the Eloqua 10 interface?



  • Lou Patrick
    Lou Patrick Posts: 194 Bronze Trophy
    edited Sep 15, 2020 7:18PM

    Looping in the product manager for this area, @Wren Ludlow-Oracle, to comment on any future plans for the Test Email feature.

  • kevincassidy313
    kevincassidy313 Posts: 5 Silver Medal

    Hi @Wren Ludlow-Oracle , can you please advise if/when this feature will be added? It's causing issues internally (people receiving test emails thinking they are actual deployments).



  • aappll
    aappll Posts: 41 Blue Ribbon
    edited Feb 4, 2022 7:14PM

    @kevincassidy313 hope it´s not to late, since you have build that customized tool, you could add a second step like, call the email api add the *TEST*+subjectLine, call the deploy API, send the email, and a final step to remove *TEST* and let save only the subject line defined. I don´t know what RPA solution you are using to call those API´s but when I use Power Automate for those that´s exaclty what I would do it.

    For me it´s not an issue because since it´s a automated process that only the stakeholder receive automatically they already know it´s a test.