This worked great! Thanks. Do you know of a way to get the Post Title of the property to be the Email Subject?
When I put [wpv-post-title] as the Email Subject it uses the Post Title of the agent's page in the Email Subject, not the property he is connected to.
Is there a way to pull the property title, which is the Post Title on this page, and the property this agent is connected to thru a relationship, into that Email subject?
The ultimate goal is to have a function where people can contact the agent about the property they are viewing.
Thanks for your time.
Hi,
To use the '[wpv-post-title]' shortcode for a related post, you can make use of the 'item' attribute, as explained here:
https://toolset.com/documentation/programmer-reference/views/views-shortcodes/item-attribute
For example, suppose the 'Property' and 'Agent' post types are connected through a one-to-many relationship, where one property can be connected to multiple agents.
( Property is parent and Agent is child in the relationship with slug 'property-agent' )
To get the title of the related property, on the single agent post, the shortcode will be:
[wpv-post-title item='@property-agent.parent']
regards,
Waqar
Hi Waqar,
I tried every type of relationship, @property-agent.parent, @property-agent.child, @property-agent.intermediary, and it never pulled the correct property of the post this agent is connected to. It pulled other properties into the email title, but not the one on the current post. Here is the URL of the page I am referring to: hidden link
If you click on the email link at the very bottom, for the agent who is connected to this property, I need "Immaculate Steakhouse With Real Estate" (the name of this property at the top of the page) in the title of the email.
PS- All the agents on the site are in a many to many relationship with the properties.
Thanks,
Mike
I figured it out! I just use $current_page.
Thanks,Mike
Thanks for the update and glad that you were able to make this work.
You're welcome to mark this ticket as resolved and start a new one for each new question or concern.