Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8203787
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T07:40:58+00:00 2026-06-07T07:40:58+00:00

I am using MailChimps inline-css form at: http://beaker.mailchimp.com/inline-css . It does a great job

  • 0

I am using MailChimps inline-css form at: http://beaker.mailchimp.com/inline-css. It does a great job of preparing an html file for use in sending as an email.

I have an api key. I prefer not to have to run their PHP app for only one API call. If it possible to use curl to access their inlineCss API? If so, what is the syntax?

Here is the doc page: http://apidocs.mailchimp.com/api/1.2/inlinecss.func.php

See also line: 2096 of this gist: https://gist.github.com/740362

My key looks something like:
f1b46???????????????????f2d5-us2

Here is a start of what I will like to achieve:

curl post -d @input.html apiKey=xxxxxxxx "http://us1.api.mailchimp.com/1.2/"

Thank you

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T07:41:00+00:00Added an answer on June 7, 2026 at 7:41 am

    This is what I hacked up for anyone looking for a similar solution. Comments, other options are welcomed:

    import os
    import re
    import urllib
    import mechanize
    import xml.sax.saxutils as saxutils
    from xml.sax.saxutils import unescape

    try:  
      issueRoot = os.environ['newslettersroot'] + os.environ['currYear'] + '/' + os.environ['issueRoot'] + '/'
    except KeyError: 
       print "Please run init.bat"
       sys.exit(1)
    
    srcEmailFilename = 'email.html'
    dstEmailFilename = 'email_inline_css.html'
    
    
    # retrieve <body> section only
    html = open(issueRoot + srcEmailFilename, 'rb').read()
    html = re.findall("(?si)<body.*?</body>", html)[0]
    
    
    # use mailchimp inlineCss site to inject class rules into html tags
    response = mechanize.urlopen("http://beaker.mailchimp.com/inline-css")
    # retrieve form
    form = mechanize.ParseResponse(response, backwards_compat=False)[0]
    
    form["html"] = html
    # form["strip"] = "checked"
    
    # submit form and retrieve result
    html = mechanize.urlopen(form.click()).read()
    
    
    match = re.search('<textarea name="text" cols="100" rows="12">(.*?)</textarea>', html, re.DOTALL | re.IGNORECASE | re.MULTILINE)
    
    if not match:
        print html
        exit("Expected to find output from mailchimp.")
    
    # clean up output
    html = match.group(1)
    html = saxutils.unescape(html)
    html = urllib.unquote_plus(html)
    html = unescape(html, {"&apos;": "'", "&quot;": '"'})
    html = html.replace('&amp;', '&').replace('%2F', '/').replace('%3A', ':')
    
    
    # @sed -r 's/ class="[a-zA-Z0-9-]+"//g' %newslettersroot%%currYear%\%issueRoot%\email_inlinedcss.html > %newslettersroot%%currYear%\%issueRoot%\email_removedstyle.html
    
    #replace class tags
    html = re.sub(r'(?sim)\s*class="[a-zA-Z0-9-]+"', "", html)
    
    fh = open(issueRoot + dstEmailFilename, 'wb')
    fh.write(html)
    fh.close()
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am composing an HTML email using a service (MailChimp). The way that MailChimp
I have tried sending and HTML formatted email using ACYmailing for Joomla AND Mailchimp.
Using the http://www.ifans.com/forums/showthread.php?t=132024 post from another question i am allowing the user to enter
I'm currently coding an HTML email, using MailChimp to test it, and eventually to
I've recently used social pro from mailchimp on a site... http://www.mailchimp.com/features/social-pro/ and was shocked
Using the HTML markup <form id=form runat=server> <input id=donkey type=text placeholder=monkey runat=server /> </form>
I am integrating the MailChimp API into my app and am using a UserObserver
Using a CSS image sprite, I'm creating an 'interactive' image where hovering over certain
using this http://bl.ocks.org/950642 we can see how to add images to nodes, the question
Using ASIHTTPRequest, I downloaded a zip file containing a folder with several audio files.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.