modified send_transactional_template function