We are trying to use EXM for the subscription, creating a page where user will enter email, click on button and they will get subscription email.

Trying to use EXM client API for this UpdateListSubscription()


IClientApiService _clientApiService;
public TestController(IClientApiService clientApiService)
    _clientApiService = clientApiService;

public void UpdateListSubscription()
            var subscribeOptions = new UpdateListSubscriptionMessage();
            var contact = new Sitecore.XConnect.Contact(
                       new Sitecore.XConnect.ContactIdentifier("ListManager", "[email protected]", Sitecore.XConnect.ContactIdentifierType.Known)
            subscribeOptions.ListSubscribeOperation = ListSubscribeOperation.Subscribe;
            subscribeOptions.MessageId = Guid.NewGuid();
            subscribeOptions.RequireSubscriptionConfirmation = true;
            subscribeOptions.ContactIdentifier= contact.Identifiers.FirstOrDefault(); 

For the Subscription using ListSubscribeOperation.Subscribe. However, it is not sending any email after running all the code and not throwing any errors.

Here we are using ContactIdentifier and what is the use of it here and how can we use this with above code.

Can someone let me know is this the right approach for the user subscription?

1 Answer 1


You can use this example code to send email using client API:

public void SendAutomatedExample(Guid messageId, ContactIdentifier identifier)
    var messageOpitons = new AutomatedMessage();

    messageOpitons.MessageId = messageId;
    messageOpitons.ContactIdentifier = identifier;
    messageOpitons.TargetLanguage = "en";

    //Send Message


  • What is the content of the email ? what is messageId and identifier here ?
    – User7864
    Mar 25, 2021 at 12:53
  • MessageId is the guid of your custom message and identifier would be the contactidentifier which you are getting in your code Mar 25, 2021 at 13:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.