I need to display "Prefix" from user contact details in Audience Manager address book, on the newsletter that is sent to user

I checked and found that the values for the name and surname are being displayed in the email sent using the below syntax:

<!-- TemplateBeginIf cond="newsletter_selected_name=='FirstName' || newsletter_selected_name=='' " -->
[* Name *]
<!-- TemplateEndIf -->

<!-- TemplateBeginIf cond="newsletter_selected_name=='LastName'" -->
[* Surname *]
<!-- TemplateEndIf -->

However, if we are using the same for prefix, it is not displaying:

<!-- TemplateBeginIf cond="prefix=='Prefix" -->
[* Prefix *]
<!-- TemplateEndIf -->

I am not sure where to look for this. Any suggestion would be really appreciated.

I have a Prefix field in my Newsletter Body Component: enter image description here

this is supposed to take the prefix value from the contact details, like the FirstName, LastName fields.

But it does not work for Prefix, even though I have values for Prefix in contact details:

enter image description here

1 Answer 1


[* Prefix *] is correct (assuming you've kept the default field). If it's not working, perhaps the problem is with the condition on the TemplateBeginIf?

Also, make sure you are testing it with Contacts that actually have a Prefix entered.

  • I have update my question with more details. The templatebegin condition is correct I think. But, maybe I am missing some other config, which I am not aware of. Please could you suggest where should I check?
    – user1905
    Commented Apr 18, 2016 at 11:02
  • If you are Testing the Mailing and use a Contact that has this field set, as you show, there is nothing else needed. The variable will be replaced by the Mailer service when it sends the test mails. Please try it without the TemplateBeginIf first, though. I'm fairly certain that is the problem. Commented Apr 18, 2016 at 12:11
  • Many Thanks..!!! that indeed was causing issues. But one query, would it not throw error in case the Prefix value is empty in the component?
    – user1905
    Commented Apr 18, 2016 at 12:52
  • It won't give an error when testing, no. When sending a Mailing you can choose, by way of the "Only send e-mail to Contacts with all required Merge Field data" checkbox. That way, if someone doesn't have the data it won't send an e-mail with missing words in them. Commented Apr 18, 2016 at 12:58
  • But, the requirement is to send an email, even if Prefix is missing for a particular contact. In that case, how should I check it?
    – user1905
    Commented Apr 18, 2016 at 13:07

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.