Find User's email through the post to be able to email them with Mail

Posted 1 year ago by almost_pitt

Hey guys,

Imagine I have a blog where registered users can post. Then, others can contact the post creator directly through the post's creator's post. In my Mail::send function, how would I find the post creator's email to have this email go directly to them?

I was trying something like this with a lot of variations, but am getting nowhere.

$message->to( $post->user_id->email);

So, essentially I'm trying to use the current post to grab the user's ID, then from there, get their email. Any ideas?

Thanks a lot guys!!

Please sign in or create an account to participate in this conversation.