Send Campaign
The send_campaign API Endpoint allows you to send in a campaign to be processed and analyzed by Campaign Cleaner. Below is the list of settings that can be set, all optional settings, if not specified will default to the bold/italicized setting.
All submitted campaigns will be sanitized.
Header:
X-CC-API-Key: Your API Key
Request Body:
Required:
send_campaign:
- campaign_html : The full HTML of your campaign
- campaign_name: The name of your campaign - campaign name must pass our sanitization checks.
Campaigns are normally processed in under 2 minutes, in most instances in a few seconds. But in some cases with very large campaigns with lots of images and links it can take longer to check those links for blacklists, redirects. image sizes and more. Depending on the server where those links resources are located it can take longer. The send campaign, will return a campaign ID once we received it, you can use that campaign ID to check on the status, and retrieve your campaign when it’s finished processing or you can supply us a webhook URL and we will send the results to you automatically.
Optional:
send_campaign:
-
adjust_font_colors: (true/false), If true, certain bright colors are spam triggers, like “red” or “#FF0000”, will be adjusted to a slightly different color like “#FF0101”, it will look the same, but won’t trigger some spam filters.
-
adjust_font_size: (true/false) If true, you will be able to define the min and max font size allowed in pixels. If your newsletter contains larger or small font’s it will adjust them to the min/max you define.
-
convert_h_to_p_tags: (true/false) If true, this will change all the H tags to P tags and set the correct font-size.
-
convert_tables_to_divs: (true/false) - This is an experimental feature to convert all the tables to divs, in certain instances with a complicated table structure you might need to edit the HTML. We recommend leaving this as false or not setting it.
-
custom_info: This field is for you to pass any additional data you want to send us, it will also be passed back to you when you call the get_campaign API. It’s limited to 500 characters. - It must pass our sanitization checks.
-
host_extensionless_images: (true/false) If true, images without extensions will be hosted on our CDN when the resize_and_host parameter is set to true. Typically, dynamically generated images lack extensions, though there are exceptions.
-
inline_css: (true/false) When set to true, CSS styles are directly applied within the style attribute of each HTML element.
-
inline_css_important: (true/false) When set to true, the
!important
flag will also be inlined with CSS styles. If you are using media queries, it is generally recommended to keep this set to false. -
media_queries_important: (true/false) When set to true, all media query styles will be marked with the
!important
flag. This ensures they can override any inline CSS without an!important
flag. -
image_max_width: (int) When this is specified, it will add an max-width style to all images. it is not desirable for the image width to exceed the default campaign width.
-
min_font_size_allowed: (10) (A positive Integer, under 100) The min_font_size must be smaller or equal to the max_font_size in pixels
-
max_font_size_allowed: (32) (A positive Integer under 100) The max_font_size must be larger or equal to the min_font_size in pixels
-
preserve_media_queries: (true/false) True, if media queries should be preserved.
-
remove_classes_and_ids: (true/false) If true, removes all the class and ID attributes after CSS Inlining.
-
remove_comments: (true/false), If true, comments are stripped from both CSS and HTML. Comments are invisible in html and can trigger spam filters.
-
remove_css_inheritance: (true/false) If true, removes all elements of CSS that are inherited. Once CSS is inlined, the inherited CSS will be removed, for example if font-size of a parent tag is 15 pixels, there is no need for the font-size of the child tag to be specified as 15 pixels because it’s inherited or computed from the parent tag, this reduces the size of your HTML Campaign.
-
remove_control_non_printable: (true/false) If true, all non-printable and control characters are removed.
-
remove_image_height: (true/false) If true, the height style is removed from all images, preventing any image distortions. Only the width property should be set on images sent in emails.
-
remove_large_widths_over: (integer) Experimental: If sets removes all defined widths over the value set on non images and table tags.
-
remove_successive_punctuation: (true/false) If true, this will remove succession punctuation like …, !!!!, $$$ to a single occurrence.
-
relative_links_base_url: If set, this needs to be a full base URL like “https://campaigncleaner.com/”, if your email campaign has any relative paths, it will be converted to an absolute URL. In most instances, you won’t need to set this.
-
replace_diacritics: (true/false) If true, replaces diacritic characters like á with normal characters equivalent, if you’re sending emails in English emails, this is a must.
-
replace_non_ascii_characters: (true/false) If true, replaces all non-ascii characters with their ascii equivalent. For example, ❝ will be replaced with ”. Non-ascii characters is of of the major spam trigger.
-
resize_and_host: (true/false) If true, we will resize, convert, and host all eligible images on our CDN. Please read our documentation here: Resizing and Hosting
-
surrounding_div: When you set any parameter of the surrounding div, it will add “div” tag around your html with the styles you set. This is helpful to set default styles and conditions that can affect the look of your html.
- max_width: The max-width style applied to the surrounding “div” can be specified in pixels as an integer value. It is typically set to the desired maximum width of the campaign, which is commonly either 600 or 900 pixels.
- text_align: (left, center, right) All content within the surrounding “div” will be aligned according to your specified style. However, you can use the “text-align” property on inner tags within the “div” to customize the appearance of your email.
- font_size: The pixel size that you want everything in the surrounding div to adhere to, setting this, will add an “!important” to the font-size in the surrounding “div”. Font sizes that are set on any tag in the HTML will retain their original size. While all unspecified font sizes to the size you chose.
- center_to_parent: (true/false) Using this feature will enable the surrounding “div” to be centered in any parent tags in which it is placed. This is particularly helpful when inserting an HTML snippet into a template.
-
webhook_url: An endpoint that you provide us and when your campaign is fully processed we will send the results back that is found in the Get Campaign API. You can utilize the webhook section under API Management to troubleshoot and test your endpoint.
Header:
X-CC-API-Key: Your API Key
Response:
campaign:
- id: The campaign id that will be used to retrieve your campaign using the get_campaign API.
Headers
Body
The body is of type object
.
Response
The response is of type object
.