cancel
Showing results for 
Search instead for 
Did you mean: 

Custom Email Message Footer State is showing as full state name rather than abbreviation

SOLVED
Highlighted
Occasional Advisor

Custom Email Message Footer State is showing as full state name rather than abbreviation

I'm using the .NET API to create and schedule an email campaign.  I'm setting up the message footer to include the address of my company with the state set to the official 2 character abbreviation (MD for example); however when my email is delivered, the message footer is displaying the full state name (Maryland for example).

 

What do I need to do to get the abbreviation in the footer rather than the full name?

10 REPLIES 10
Moderator

Re: Custom Email Message Footer State is showing as full state name rather than abbreviation

Hi, Here's the documentation for how the email campaign endpoint works. 

 

http://developer.constantcontact.com/docs/email-campaigns/email-campaign-resource.html

 

The state property only accommodates 2 letter standard US state abbreviations. Can you send along your code, and the payload of the campaign that contains the full state name in the footer?

Rich Marcucella
Sr. Technical Writer, Content Developer
Web Services Team
http://developer.constantcontact.com
Occasional Advisor

Re: Custom Email Message Footer State is showing as full state name rather than abbreviation

Thanks, I saw and I have set my message footer up according to the documentation... setting the "state" propery to "MA" as shown in the documentation.

 

The problem is that when the email is delivered, it displays "MASSACHUSETTS" instead of "MA" and I really don't want my custom email yelling the state name.

 

Is there some indicator that tells it to use the abbreviation rather than the full name?

Moderator

Re: Custom Email Message Footer State is showing as full state name rather than abbreviation

Karl,

 

If you do a GET Campaign/<campaignId> call, MA (or MD) is the value returned for state?  It should...hmmm...I just sent a custom email yesterday and the footer used the abbreviation. 

 

If you do a GET https://api.constantcontact.com/v2/account/info, check to see what the values are for the state and state_code fields. I'm not sure why this is happening, and I'd be interested to see what these properties are. If you don't set the footer address in a campaign, it pulls the address info from your account-info.

 

docs here: http://developer.constantcontact.com/docs/account/summary-information-api.html

Rich Marcucella
Sr. Technical Writer, Content Developer
Web Services Team
http://developer.constantcontact.com
Occasional Advisor

Re: Custom Email Message Footer State is showing as full state name rather than abbreviation

When I do the //api.constantcontact.com/v2/account/info call,  I get my 2 digit home state abbreviation for "state_code" in the main structure and in the "organization_addresses" structure.  I only have 1 address in that structure.  There is not a "state" property in the structure at all.

 

When I look at the campaign via the //api.constantcontact.com/v2/emailmarketing/campaigns/<campaignId> call, I can see that the "message_footer" has a "state" property which is set to "CA" (in the test campaign I'm currently looking at), the "international_state" is an empty string.  There are no other "state" type properties in the structure (not even in my "email_content").  However... Capture.PNG

That is the result on the email.

 

Here's a screen print of the footer...

Capture2.PNG

 

 

 

Honored Contributor

Re: Custom Email Message Footer State is showing as full state name rather than abbreviation

Hi Karl,

 

Whenever a state is provided as a 2 letter US state code, our system will fill out the state name in the footer as you have shown. In order to bypass this when creaitng campaigns in the API, you will need to set the "state" field to blank and instead place the 2-letter code into the "international_state" field so that it is not automatically processed and displayed as a full name.

 

If you have any difficulty with this, please let us know!

 

Best Regards,

Elijah G.
API Support Engineer
Occasional Advisor

Re: Custom Email Message Footer State is showing as full state name rather than abbreviation

Unfortunately, that solution causes the following error when I attempt to create the new campaign:

 

json.field.message_footer.state.invalid:Instance value does not match any String value. Valid options are: AL, AK, AZ, AR, AA, AE, AP, CA, CO, CT, DE, DC, FL, GA, HI, ID, IL, IN, IA, KS, KY, LA, ME, MD, MA, MI, MN, MS, MO, MT, NE, NV, NH, NJ, NM, NY, NC, ND, OH, OK, OR, PA, RI, SC, SD, TN, TX, UT, VT, VA, WA, WV, WI, WY.
json.field.required.us.address.fields.missing:state and postal_code need to be set if country is set to US.

 

So it looks like I would also need to change the Country, is that true?  And if so to what do I change it?

 

And then let's discuss whether what we are suggesting to do here makes logical sense... If the footer using the default address from the account, then the state is displayed using the 2 digit Postal Code.  So why would we stray away from that when we pass a postal code in a custom footer structure?

 

I would think a much better interface would allow me to pass in AL or ALABAMA, but not BAMA, and it would ignore character case in the validation giving the user the ability to display their footer address in all lowercase or all uppercase or any mix in between. 

 

Honored Contributor

Re: Custom Email Message Footer State is showing as full state name rather than abbreviation

Hi Karl,

 

After looking into this deeper, what I found was that the email signature system always requires a 2-character state code when the country is set as United States. When the email is then sent out, this 2-character code is converted to a full state name by our mailing system and displayed as that name in the final message.

 

Currently the only way to display a 2-character code in the footer of an email would be to set the country in the footer to a non-US value.

 

Please let me know if there is any more information that I can provide on this!

 

Sincerely,

Elijah G.
API Support Engineer
Occasional Advisor

Re: Custom Email Message Footer State is showing as full state name rather than abbreviation

Hi Elijah,

 

Is the "mailing system" used by the API the same "mailing system" that is used when I create a custom email via the constantcontact.com website?  If so, then why would my result from the website look like this:

 

CustomFromWS.PNG

I also did a little more digging and when I look at the message footer of a campaign that I created via the API I see this:

Capture3.PNG

 

But, when I look at message footer of the email campaign that I created via the website directly, I see this:

Capture4.PNG

 

This gives the appearance to me that the API may not be properly feeding the data to the system and perhaps that is why we are seeing the difference in the footer that is delivered to our customers.

 

Beyond that, if you are saying that the only way for me to display a 2-character code in the footer is to create a non-US value, then can you provide me with the proper values to setup that footer?

 

Thanks again for your help,

 

Karl

Honored Contributor

Re: Custom Email Message Footer State is showing as full state name rather than abbreviation

Hi Karl,

 

Firstly, my apologies for the delay in getting back to you on this.

 

I have been doing a great deal more investigation on this, and have been able to achieve a consistent result of displaying only the two-character state code in an email rather than showing the full state name. This result was tested today to be functional with both the API and the UI. Here is the JSON payload I was able to use when creating a campaign to get this result:

 

{
    "name": "Dec 19 2015 #2",
    "subject": "Dec 19 2015 #2",
    "from_name": "My Organization",
    "from_email": "email@example.com",
    "reply_to_email": "email@example.com",
    "is_permission_reminder_enabled": true,
    "permission_reminder_text": "As a reminder, you're receiving this email because you have expressed an interest in MyCompany. Don't forget to add from_email@example.com to your address book so we'll be sure to land in your inbox! You may unsubscribe if you no longer wish to receive our emails.",
    "is_view_as_webpage_enabled": true,
    "view_as_web_page_text": "View this message as a web page",
    "view_as_web_page_link_text": "Click here",
    "greeting_salutations": "Hello",
    "greeting_name": "FIRST_NAME",
    "greeting_string": "Dear ",
    "email_content": "<html><body><p>This is text of the email message.</p></body></html>",
    "text_content": "This is the text-only content of the email message for mail clients that do not support HTML.",
    "email_content_format": "HTML",
    "style_sheet": "",
    "message_footer": {
        "organization_name": "My Organization",
        "address_line_1": "123 Maple Street",
        "address_line_2": "Suite 1",
        "address_line_3": "",
        "city": "Anytown",
        "state": "MA",
        "international_state": "",
        "postal_code": "01444",
        "country": "US",
        "include_forward_email": true,
        "forward_email_link_text": "Click here to forward this message",
        "include_subscribe_link": true,
        "subscribe_link_text": "Subscribe to Our Newsletter!"
    }
   }

 

Here is a screenshot of the footer from this email:

Screen Shot 2014-12-19 at 5.05.37 PM.png

 

If you are not able to reproduce my results, it would be a great help if you can provide the JSON used (with sensitive details omitted/changed).

 

Sincerely,

Elijah G.
API Support Engineer