I created a classic email template and have merged fields from a custom object called Order (not the native Salesforce Order object).

The following merged fields don't seem to work:

Order Name: {!NU__Order__c.Name} Pay NOW URL: {!NU__Order__c.PayNowUrl__c} Payment URL: {!NU__Order__c.NU__PaymentUrl__c}

However, oddly enough this one works:

Balance: {!NU__Order__c.NU__Balance__c}

And this one works - {!Order.Name} - even though we aren't using the standard Order object.

All the above fields on the Order record are populated.

I even tried fields on a related object (Cart):

TEST: {!NU__Cart__c.NU__PaymentUrl__c} TEST: {!NU__Cart__c.PayNowUrl__c}

Thanks in advance for any help. Looking through some help docs but have not found any solution yet.

Regards, Wil

  • Can you share more of your template? A key part of this will be the attributes in your messaging:emailTemplate tag.
    – nbrown
    Apr 8 '21 at 20:42
  • How are you calling this template? Email Alert or Apex or something else?
    – edralph
    Apr 8 '21 at 22:07

It could be that your email is being triggered from some object where there is not an "NU__Order__c" record in context.

When you say "balance__c" works and "order.name" works - how do you know they work? If you don't use the standard order object, it would have no name, and you wouldn't see anything on the template.

  • Thanks, the issue is that the custom object (Order) is named exactly like the native Order object which prevented the merged fields to be displayed.
    – Wilson Pho
    Apr 10 '21 at 15:22

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.