TclMML

TclMML Frequently Asked Questions

[ Home | Docs | FAQ | Download | CVS | Mailing Lists | Bug Tracker | USPS's MOL Site ]
  1. Where can I get a copy of the Mail Management Language Definition?

    We've been told that the MML Definition documentation will be publicly available on the usps.com website soon. In the meantime, however, you can request a copy from Nora Taylor at USPS HQ in Washington DC.

    Since the MML interface to the MOL system is relatively new, obtaining the MML Definition directly from the USPS will give them a better understanding of who is using MML, for what types of applications, what their needs are, etc.

  2. Do I need separate logins for production vs staging?

    Yes, you do. The staging system and the production system do not share the same authentication information. You must register for each system separately. The MML documentation (see above for how to obtain it from the USPS) addresses this.

  3. Why tDOM and not TclDOM?

    We chose tDOM primarily because of its speed, and because it can be compiled as a .so shared library for AOLserver. TclDOM support will be added if/when requested.

  4. Any tips for adding MML processing to an application that doesn't use TclMML?

    The XML response from the MOL system (currently) is not always well-formed XML and most XML parsers will complain if the XML isn't massaged before hand. Specific issues we've noted are:

  5. How about an example script showing TclMML in action?

    The Mail Management Language Definition has several example exchanges of MML requests & responses. Here are several of those examples translated into TclMML:

    package require TclMML
    mml::connect -staging mml username password
    
    
    # TclMML version of "MML example of uploading a document"
    # cf. "USPS Mail Management Language Definition," 8 Oct 2002, page 39
    
    set inline_postscript {%!PS
    initgraphics /Helvetica findfont 18 scalefont setfont
    72 600 moveto (Thank you for using Mailing Online, and using the MML) dup show
    72 580 moveto (standard for your printing and mailing needs.) dup show
    exch = =
    showpage}
    
    set doc_id [mml upload document -data $inline_postscript "My Document"]
    
    
    # TclMML version of "MML example of uploading a maillist"
    # cf. "USPS Mail Management Language Definition," 8 Oct 2002, page 40-41
    
    set addresses ""
    append addresses NAME \t ADDRESS \t CITY \t STATE \t ZIP \n
    append addresses USPS \t \ 
                     "475 L'Enfant Plz SW RM 5412" \t \ 
                     Washington \t DC \t 20260-4410
    
    set mappings [list fullname NAME \ 
                       addressline1 ADDRESS \ 
                       city CITY \ 
                       state STATE \ 
                       postcode ZIP]
    
    set ml_id [mml upload mailing -data $addresses \ 
                                  -mappings $mappings \ 
                                  -keep_all "My Mail List"]
    
    
    # TclMML version of "MML example of submitting and paying for an order"
    # cf. "USPS Mail Management Language Definition," 8 Oct 2002, page 42-43
    
    set ra_id [mml upload return_address -fullname "Baesystems" \ 
                                         -address1 "11400 Commerce Park Dr" \ 
                                         -city Reston \ 
                                         -state VA \ 
                                         -zipcode 20191 "Example Return Addr"]
    
    set order_id [mml upload order -document $doc_id \ 
                                   -mailing_list $ml_id \ 
                                   -return_address $ra_id \ 
                                   -color "Red Spot Color" \ 
                                   -cc_type Visa \ 
                                   -cc_number xxxxxxxxxxxxxxxx \ 
                                   -cc_month February \ 
                                   -cc_year 2003]
    
    set cost [mml order details $order_id total_cost]