Insert post_meta into email notification message

Labels

This Discussion is public

Notifications

I have a form to place bids. Each item has its own post and I have set a custom field on the posts so that I can insert [post_meta key="Item"] into a read-only form field so I know for which item the bid was submitted.

I want to send an email saying, “thank you for bidding on item [post_meta key="Item"], but post_meta doesn’t render in the email notification message. I have also tried putting the field ID which has the meta key in the message, “thank you for bidding on item [75]” but the message returns a 0 instead of the post_meta field value. (thank you for bidding on 0)

Is there any other way I can achieve my intended results of rendering the [post_meta key="Item"] in the email notification message the user receives when they submit their form?

I have found the solution to my problem and am posting it here should it be able to help anybody else. Using the field ID in the email notification does work but only if the field is hidden. Mine were not hidden, just set as read-only. Now I have two fields for the [post_meta key="Item"], one that is read only so the front end user can see it appear on the form but also one that is a hidden field so that I can use that hidden field's ID in my email notification.

Discussion closed.