Twillio How To Send SMS for Custom Post Type

You should be able to change publish_post to publish_sms then remove any conditional logic. This is due to the following hook:
https://developer.wordpress.org/reference/hooks/new_status_post-post_type/

This is a bit of an aside, but I’m making the assumption you’ve defined your post type key as sms (all lowercase) if not then you may need to use publish_SMS but it’s generally best practice to use lowercase keys.

Leave a Comment