4

I am trying to send an email to a contact when they register or update their profile. The Outbound Email CD API provides the following example for sending an email on a contact update:

Contact contact = new Contact();
contact.ExtendedDetails["Identification_key"].Value = "john.mason@somedomain.com";
contact.ExtendedDetails["Identification_source"].Value = "Global";
contact.EmailAddress = "john_mason@somedomain.com";
contact.ExtendedDetails["NAME"].Value = "John";
contact.ExtendedDetails["SURNAME"].Value = "Mason";
contact.Save("tcm:42-4711-64");

A notification page ID is passed to the Save method, which is somehow supposed to trigger the mailing.

I am a bit confused as to what actually is supposed to happen. What type of item are you passing to the Save method?

How will this trigger a mailing?

Even though this is the CD API, does this email get sent from the CM?

3

Confirmation e-mails are not Mailings, unfortunately. They should be, but we haven't gotten around to changing them yet (a question of priorities).

As such, you need to specify the information that is normally contained in a Mailing in a number of different ways:

  1. When creating the Contact on your website (contact.Save method), you pass in the URI of the Page that you want to render and use as the body of the e-mail.
  2. In the OutboundEmail.xml configuration on the Content Manager, you specify the Publication Target to use when rendering and the e-mail headers such as the name and e-mail address to use as the sender, the subject of the e-mail, etc. You can specify these settings for all confirmation e-mails at once or selectively overwrite the settings for specific confirmation e-mails (based on the Page you chose to render). See "Configuring confirmation e-mails" for more on this.
  3. When the Contact is synchronized and thus created on the Content Manager, the confirmation e-mail will be created based on the information specified in step 1 and 2 - and the e-mail will be sent to the Contact's e-mail address.

The same steps can happen when you edit and save an existing Contact. For instance, this is used when confirming the subscription: the Contact's subscription status is updated and a new e-mail is often sent to let the Contact know that the opt-in process was successful.

| improve this answer | |
  • I know this is an old thread, but I just want to know how is this different then setting up a Triggered Mailing? The confirmation emails can either be triggered through the Contact.Save(PageURI) method or through a Triggered Mailing. Is there a rule for deciding which approach to use when? – Husain Zahid Jul 13 '14 at 12:00
  • There are indeed a lot of similarities between the two, with Triggered Mailings applying to more use cases in general. I suppose you can do these confirmations with Triggered Mailings too, with the caveat that it will never send the same Mailing twice to the same Contact. So you could not do a "your profile has been changed" type confirmation e-mail with Triggered Mailings. There might be other restrictions that I can't think of right now. – Peter Kjaer Jul 14 '14 at 11:14
3

You need to set up it in the OutboundEmail.xml file, it is not needed to set up Triggered Emails, here a sample:

<ConfirmationEmail page="tcm:11-556-64">
    <Subject>Subject</Subject>
    <SenderName>Sender</SenderName>
    <SenderAddress>email@server.com</SenderAddress>
    <!--<ReplyAddress>newsletter@localhost</ReplyAddress>-->
    <!--<RequireAllFields>false</RequireAllFields>-->
</ConfirmationEmail>

Once you have this, you can start sending emails after you call.

Contact.Save("tcm:11-556-64");
| improve this answer | |
  • I saw this method previously. In this example, what kind of item is tcm:11-556-64? – bsrva Nov 6 '13 at 21:01
  • This is the page that renders the email – Eric Huiza Nov 6 '13 at 21:04
  • Is there any documentation for setting that part up? – bsrva Nov 6 '13 at 21:58
  • Yes, you can find it here sdllivecontent.sdl.com/LiveContent/web/… – Eric Huiza Nov 6 '13 at 22:21
2

You need to setup the triggered emails on the CM side. Check the documentation for reference (requires login).

You also need to make sure that you setup AM Profile sync between CM and CD. The emails get sent from CM side (using the Outbound Email), so you need have the working email templates and tested.

| improve this answer | |
  • Yes, I saw the documentation. It does not mention what item's tcmid should be passed to the contact Save method. Is it to a mailing? A page? – bsrva Nov 6 '13 at 20:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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