Populate mailto links subject and body with page name
-
Hello. I am trying to figure out how to add custom subject and body text to an email from a mailto link from a WordPress page. I would like it to populate the subject with part(s) of the page, like the title. For instance, the subject line would say something like “Info request for “Name/Title of the WordPress Page”” and the body would be something like “Hello, I am looking to receive more information about “Name/Title of WordPress Page”. Please tell me more.” Where in both cases the name of the page in WordPress would be pulled into the subject line and the body copy. I assume I have to do this in my functions.php file, but not sure and not sure how. I know I can do it in the mailto html code itself, but that would have to be changed for each page and I am trying to make it automated so that when new pages based on the same template page are created, it will take from the page title itself and add it into the subject and body when the mailto link is clicked. Hope that makes sense.
- The topic ‘Populate mailto links subject and body with page name’ is closed to new replies.