In a theme I'm developing I would like to have a button with a mailto: href so that it when a user clicks on it, it generates the email address dependent on the post author.
I've managed to get it so that the email subject is generated from the post title by simply using the the_title();
I can't seem to work out how to dynamically generate the email address though. I need to replace the "firstname.lastname@example.org" part that is hard-coded below to automatically be the post author's email that is registered in their user profile in the back end.
I was looking at get_the_author_meta(); function, but this only seems to allow you to add a parameter for 'user_email' and then you have to manually add the user ID, which again is no use.
<a href="mailto:email@example.com?subject=<?php the_title(); ?>">Apply</a>
Any help would be amazing.