• Omegakenshin

    (@omegakenshin)


    Hi, I want to know the action for when you click on the Publish button,

    I got a custom post type for client’s orders, so when I add an order, I want to send an email to my Client email with the data.

    Hope you can help me, I really apreciate your time.
    Thanks

    Edit: I think the answer is

    <?php
    add_action('publish_post', 'my_custom_function');
    ?>

    but how can I tell it, to send the email just when is the custom post “orders”.

Viewing 1 replies (of 1 total)
  • ucfknight10

    (@ucfknight10)

    in the definition of my_custom_function, you’ll want to grab the variable $post or $id, using global $id,$post;. from there, you can determine the post type

Viewing 1 replies (of 1 total)
  • The topic ‘Send email when publish custom post – Action’ is closed to new replies.