I'm trying to add dynamic data into the email that I autogenerate. I am taking this sort of approach:
setting the parameters
$insight = rwmb_get_value( $insight, $post_id );
then adding this inside the email message text. I think this is where I'm most stuck.
$message = " xxxxxxxfdjgfnk insight: "$insight" sxxxxx";
then sending the email
wp_mail( $email, $subject, $message);
This way is causing a fatal error, so Im not sure how to approach this.
In short, I basically want to apply this snippet for MB: https://www.wpbeginner.com/plugins/how-to-email-authors-when-their-articles-are-published-in-wordpress/
Can you help?