Ideally I would include custom liquid code in the email block, and the code would point to the recipient of the email as the customer whose metafield should be accessed/displayed.
Yes, it is possible to insert a customer metafield into a Shopify email message using the custom Liquid block.
A metafield is a way to store additional information about an object in Shopify, such as a product, an order, or a customer.
To insert a customer metafield into a Shopify email message, you will need to use the Liquid programming language. You can access the Liquid code by navigating to the “Online Store” section of your Shopify admin panel, then clicking on “Themes” and finally “Actions” and select “Edit code”.
You can create a custom Liquid block and insert it into the email template. In the block, you can access the customer metafield using the following code: {{ customer.metafields.namespace.key }}, where “namespace” and “key” are the specific namespace and key of the metafield you want to access.
For example, if you have a metafield with the namespace “membership” and the key “level”, you can access it in the email template using the following code:
{{ customer.metafields.membership.level }}.
You can insert this code into the email template where you want the metafield to be displayed.
It’s worth mentioning that you must have already created the metafield you want to use, if not, you should create it first.
The method you are describing sounds like it will edit the template for the individual email messages sent when clicking on a customer’s email address link in the Shopify admin.
I was referring to the “Shopify Email” app. I want to be able to send emails to a customer segment, but have the messages customized using content pulled from the customer metafields.
Shopify Email app will allow for Custom Liquid blocks to be used, but those blocks do not seem to be able to pull data from customer metafields. The Shopify Email app also has a “Personalization” feature for customer data, but is currently limited to name and address fields in the customer account.
Create a new Customer metafield myfield (with a “custom” namespace, so with namespace it’s “custom.myfield”)
Create a dummy customer with your own email address, set a value in that field for yourself
Add a liquid block somewhere on the website (i.e. at the bottom of the Cart page) with just this text: {{ customer.metafields.custom.myfield }}
Login with that email and visit the Cart page => verify the value of the field is present
Create an email template adding a liquid block and inside that block having exactly the same code that worked on a Cart page: {{ customer.metafields.custom.myfield }}
Start an email campaign by only including your own email in the mailing list
Open an email and verify that there is no value for {{ customer.metafields.custom.myfield }}
Not having this feature limits the use of powerful apps that rely on custom fields, I’d really love if customer metafields were supported by email marketing campaigns.
Very frustrating that most Shopify included apps go 90% of the way. Tags is an element of the customer object and should work. If you use the tag in an email template it jsut puts out a blank even though there is data in the tags. {{data.customer.tags.first}}