1

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

0

[* 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.

6
  • 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 Apr 18 '16 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. – Peter Kjaer Apr 18 '16 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 Apr 18 '16 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. – Peter Kjaer Apr 18 '16 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 Apr 18 '16 at 13:07

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.