PHP Echo inside Wordpress Shortcode
In the my_contact_form_generate_response
function, you can do return $response;
at the very bottom before the closing }
for the function.
Then, you can do echo my_contact_form_generate_response($type, $message);
and it will echo the return
value, which will be $response
in this case.