OptimizeHtml

Evaluates the code for a given Email Test ID and returns suggested fixes to improve the issues with the email's deliverability.

URLs:

Sandbox:

https://sandbox.emailonacid.com/v4/optimizeHtml - Default (XML) Request
https://sandbox.emailonacid.com/v4/optimizeHtml/xml - XML Request
https://sandbox.emailonacid.com/v4/optimizeHtml/json - JSON Request

Production:

https://api.emailonacid.com/v4/optimizeHtml - Default (XML) Request
https://api.emailonacid.com/v4/optimizeHtml/xml - XML Request
https://api.emailonacid.com/v4/optimizeHtml/json - JSON Request

Request:

XML

<?xml version="1.0" encoding="utf-8"?>
<optimize_html>
    <eoa_test_id>UNIQUE EMAIL TEST ID</eoa_test_id>
</optimize_html>

JSON

{
    "eoa_test_id" : UNIQUE EMAIL TEST ID
}

Request Details

Element Description Data Type Required
eoa_test_id The reference id for the test to retrieve Integer Y

Response:

XML

<?xml version="1.0" encoding="utf-8"?>
<xml>
    <html_optimization>
        <optimized_html>
                <optimization_messages>
                    <optimization_message>
                        <name> <![CDATA[...]]> </name>
                        <description> <![CDATA[...]]> </description>
                        <solution> <![CDATA[...]]> </solution>
                        <affected_clients>
                             <client> <![CDATA[...]]> </client>
                        </affected_clients>
                    </optimization_message>
                    ....
                </optimization_messages>
        </optimized_html>
        <html_validation>
            <validation_message>
                <severity>Warning</severity>
                <line>11</line>
                <column>1</column>
                <message><![CDATA[<meta> element not empty or not closed]]></message>
            </validation_message>
          ....
        </html_validation>
    </html_optimization>
</xml>

JSON

{
    "html_optimization":
    {
        "optimized_html"        : "<!DOCTYPE ...> <html>...</html>"
        "optimization_messages" :
        [
            {
                "optimization_message" :
                {
                    "name"              : "Ent 04\/TB3 Image Alignment",
                    "description"       : "If an image has a value of right or left for the alignment property 3px padding will be added to the...",
                    "solution"          : "Add a margin:0 to the inline style....",
                    "affected_clients"  :
                    [
                        {
                            "client" : "AOL Web"
                        },
                        ...
                    ]
                }
            },
            ....
        ],
        "validation_messages" :
        [
            {
                "validation_message" :
                {
                    "severity"  : "Warning",
                    "line"      : "238",
                    "column"    : "1",
                    "message"   : "<style> isn't allowed in <body> elements"
                }
            }
        ]
    }
}

Response Details

Element Description Data Type
html_optimization Object containing optimized_html, optimization_messages and validation_messages. Object / Has Children
optimized_html Your HTML after undergoing the optimization process. Alpha-numeric String
optimization_messages A list of messages explaining what was changed and why. Array / Has Children
name Message title. Alpha-numeric String
description Why the code was an issue. Alpha-numeric String
solution How the code was optimized. Alpha-numeric String
affected_clients An object containing every client that will react to change. Array / Has Children
client The browser client. Alpha-numeric String
validation_messages Set of messages notifying of possible issues with submitted code. Array / Has Children
validation_message A single message notifying of possible issues with submitted code. Object / Has Children
severity An indicator of the severity of the found error. Alpha-numeric String
line The line number in the submitted file. Alpha-numeric String
column Your HTML after undergoing the optimization process. Alpha-numeric String
message Why the code was an issue. Alpha-numeric String