I'm sending automated mail to a single user. I want a basic statement that verifies if they are set to receie admin emails. Similar to this:
PHP Code:
if (SetToRecieveAdminEmail == 'Yes'){
mail($recipient, $subject, $message, $headers);
echo "message sent";
} else {
echo "user doesn't want mail";
}
I've already queried the user table for this single users information but I don't know how to query the bit field for this specific option setting.
If I use a where clause with the options & 16 then the query will obviously return no results if the user has opted out. This will result in no recipient. Which would mean no mail is not sent. But I'm not sure that's the best way to go about this. It seems messy.