Sample: Work with marketing lists

This sample code is for Microsoft Dynamics Marketing. The sample code can be found in the following location after you download and install the Microsoft Dynamics Marketing SDK:

Samples\CS\MarketingListSample

Requirements

  1. Download and install the Microsoft Dynamics Marketing SDK.

  2. Enable the SDK gateway and assign permissions to queues. More information: Authorize queues

  3. Follow the instructions provided in the Quick start with sample code to install, build, and run the sample.

Note

This sample works with your live production data. It may create contact objects in your Microsoft Dynamics Marketing and Microsoft Dynamics CRM environments. In addition, it will send emails to the designated recipients.

Tip

  • You should allocate some email addresses that actually exist as a test audience, and then write scenario tests that run against the test audience. Create a marketing list specifically for testing mails and create test contacts with email addresses you control as an audience for testing your email marketing messages and SDK integration code.

  • Use email marketing message testing functions to determine if the email messages are formatted correctly before sending the email messages.

Demonstrates

This sample demonstrates how to work with marketing lists via the SDK as part of the list segmentation functionality in Microsoft Dynamics Marketing.

Example

Troubleshooting

  • If the response is not received in time, you’ll get the following error message:

    “The request has been sent but the response was not received. You may want to wait a few more seconds and try to receive the response again or try increasing the ResponseMessageTimeout in client.cs.”

    Some of the possible reasons why the response is not received:

    • The server took longer than expected to process this response. Try selecting Option A, to see the response. If this issue occurs frequently, consider changing the value of the ResponseMessageTimeout constant in your client.cs file.

    • Either your client is looking at the wrong response queue, or Microsoft Dynamics Marketing is unable to write to the response queue due to a configuration error. To know how to setup your queues correctly, see Getting started with the SDK

  • If you don’t receive a response immediately, try using the Get all responses for this session option. Sometimes a response may take longer than the default time-out period.

  • If you never receive the response, make sure your request and response queue names and namespace matches the details you provided on the Home > Settings > Administrator > Integration Options. More information: Site configuration and integration settings page.

  • Unlike email messages, if you enter an email address that doesn’t match a contact in Microsoft Dynamics Marketing, a new contact won’t be created. Instead, the email address will be skipped or the request will fail.

  • Sign in to Microsoft Dynamics Marketing and go to Home > Marketing Execution > Marketing Lists > Marketing Lists. If you’re not able to view the marketing list that you have created with Option 7, make sure you click the Show All/Active only icon. The marketing lists created though the SDK will be listed as Created By SDK SYNCHRONIZATION AGENT in the user interface.

  • If you add the contacts to the marketing list using the command option Add contact to Marketing list, you get the following error message:

    “Contact <email address> does not exists”

    There is no contact in Dynamics Marketing with the specified email address that you’re using. You must first create the contact in Dynamics Marketing, and then get the external ID for the email message either from the Retrieve action or on the Home > Marketing Execution > Marketing Database > Marketing Contacts by clicking on the Customize column icon and selecting External ID from the list.

See Also

Tasks

Quick start with sample code

Reference

Microsoft.Dynamics.Marketing.SDK.Common
Microsoft.Dynamics.Marketing.SDK.Messages
Microsoft.Dynamics.Marketing.SDK.Messages.MarketingList
Microsoft.Dynamics.Marketing.SDK.Model

Concepts

Developer overview of Microsoft Dynamics Marketing
Introduction to marketing entities
Manage lists and send transactional or commercial email
Getting started with the SDK
Sample code
Assembly included in the Microsoft Dynamics Marketing SDK

Other Resources

Programming reference for Microsoft Dynamics Marketing

Send comments about this topic to Microsoft.
© 2015 Microsoft. All rights reserved.