1

Please could someone tell me what is wrong with the following Dear contact.nickname Thank you. I know that brackets need to be used.

1

Yes you need brackets: the curly { } kind

When composing a mail mesage - hit the Insert token button on the right - select the one you want - and it will insert it in the text (where your cursor was located) - including the { }

1

Note that nickname is an optional field for each contact.

If you use "Dear {contact.nick_name}," then contacts who do not have a nickname defined will end up with "Dear ,".

I suggest using {contact.first_name} instead.

If you really want to use nicknames, you could create hooks to define a new token, e.g. contact.nick_or_first_name, and populate it with nickname if it is not null, or else first name.

  • Thank you very much. The problem was the absence of the underscore between nick and name. I had been mislead by the inconsistent display names. What I have been doing is using the token 'email greeting' This enables me to use a nick name when the prefered salutation is not first name. I encountered the syntax problem when customising the email greeting. – SPM Mar 6 '17 at 12:06
1

If you are on a screen that offers 'tokens' in top right, eg on 'send email' or 'new mailing' etc then you can just type in 'nick' and it will offer you the relevant token(s) and then you will get the spelling correct automatically.

1

I used a custom token (based on Coleman's blog post) to look and see if there is a nickname. If not it will default to first name.

https://civicrm.org/blog/colemanw/create-your-own-tokens-for-fun-and-profit

So I can use the nick_name token without worry it would be a blank field.

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.