Meta boxes are inside the post edit form tags, so you do not want a true submit button because that would submit the entire edited post form to be published or updated.
Instead, provide a object that invokes a jQuery function when clicked. That function submits an AJAX request. Your AJAX handler is what actually does the mailing. For more on AJAX, you could start with AJAX in Plugins.
Thread Starter
One234
(@one234)
Hi bcworkz,
thank you for your reply.
I understand, I think i will try to use a checkbox which will be checked at save_post, if this ist checked, i will send the mail.
Will this work and have you an good example for that?
TIA 🙂
Yes that will work, and is easier to code than my suggestion. It’s not a “good” example, but there is a mail on post_save example. The difference being you need to check that the $_POST element keyed by the checkbox name is set before sending the mail. And the mail recipients would be different of course.