I am required to use the {domain} token for mass mailing, but it is formatted with line breaks .. can I modify that formatting ?


I believe there are several domain tokens. domain.Name, domain.Address, domain.email, domain.phone.

These are set on the Administer => Communications => Organization Address and Contact Info page.

The only one that I think is required is domain.address. This has line breaks between the street address and the city, etc. You can blank out address, the city and remove the zip but getting rid of the country and state may not be possible. (Well if you are in a country without states you can get rid of state)

The {domain.address} is a smarty. You can do all sorts of things with smarties. You might be able use regex to replace the line breaks or to remove parts of the address you don't want. http://www.smarty.net/

| improve this answer | |

This is computed in CRM/Utils/Token.php in the function getDomainTokenReplacement (which in turn gets it from the function getLocationValues)

I think you might be able to override this in the tokenValues hook and send in your own value for domain.addresss. Creating your own tokens is described here:


| improve this answer | |

To my knowledge, you can't really do much with how it prints. But you can use CSS to set display:none on it. There is also a global CiviMail setting that allows you to send mailings without using the token.

| improve this answer | |

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.