If you create a formula field (for example, User.Phone_Merge__c
) where the formula is something like this: IF(ISBLANK(Phone),"No Phone Number",Phone)
then you can use the formula in the email. I realize this isn't a perfect solution nor is it feasible in all situations but it does work.
Additionally, it seems like Salesforce is still bringing Lightning email up to speed. It does not handle blank merge fields at all right now, so it makes sense that they want to prohibit their use. Try this:
- Navigate to Salesforce Classic
- Visit your Account record - or if you would like to test this fresh, create a new Account.
- Click "Send an Email"
- Try the same merge field in that email
{!User.Phone}
- The email will show the raw text
{!User.Phone}
- Switch to lightning experience.
- Navigate to that Account.
- You should receive an error like this:
Until Salesforce adds in support for ISBLANK/BLANKVALUE or blank merge fields, then I think a formula field will be the way to go. One final note, you MUST have at least one non-whitespace character in order for the formula field to work, otherwise you will get the same blank value error.