Solved

Failed messages

  • 18 August 2022
  • 1 reply
  • 274 views

Hi there! We have a bunch of failed messages lately and we keep seeing the reason as variable ‘customer.email’ is missing. When I checked our customer attributes, our users have their email addresses added either under email or Email address. How can we fix this to make sure our emails land in our customers’ inboxes?

icon

Best answer by Jess 18 August 2022, 17:23

View original

1 reply

Badge

Hi astrabelle!

Messages will fail when attributes are missing, this is to prevent sending awkward codes on your email. This is why we highly recommend using a liquid fallback in case an attribute is not available. Read more about it here.

In your case, your customer's email addresses are either on your attribute email or Email address. You can also use the following liquid:

{% if customer.email != blank %}{{customer.email}} {% else %} {{ customer["Email address"] }} {% endif %}

If your customer email attribute is not blank, it will use the email. However, if it’s empty, then it will use the attribute Email address instead.

Because your email attribute is missing from your other customers’ profiles, I assume that your messages are failing because your To address is empty. You can also add this liquid fallback on your To address. Simply click the Customize button and paste the above liquid.

When possible, we suggest defining and enforcing a naming convention for your attributes. We also advise using all lowercase letters and using “_” instead of spaces. 😊

I hope this helps!

Reply