• Hi,

    I’m trying to add a simple button to one of my pages which upon being clicked would send an email to an address which is set in a custom field, the content would come from the user’s profile if they are logged in.

    If the user is not logged in then the button will not show, that’s a simple if statement so no need to worry there.

    I can’t work out how to do this using wp_mail. Please can you help?

Viewing 1 replies (of 1 total)
  • Thread Starter mortonc

    (@mortonc)

    Here’s a walkthrough:

    • Steve is logged in and visits this page.
    • Steve clicks the button
    • An email is then sent to an email address which is associated with this specific page (in a custom field), the subject will be preset, the from address will come from the current user’s profile and email text can be something like “you’ve been mailed by Steve who has 12 points” , this value of 12 is set as a custom field in their profile.
    • Steve then sees a success or error message
Viewing 1 replies (of 1 total)
  • The topic ‘Add a button to send an email’ is closed to new replies.