Use mailform multiple times

does anybdy know how I can use this mailformsnippet from @bastianallgeier on the same website in multiple times?

I don´t know what you want to achieve in particular, but:

You can have multiple pages with the mail form as with every other page you create using the same template. You can have a different article text anyway by changing it in the panel or the text file of the page.

If you want to have different forms (different form fields), you must duplicate the template and controller with a different name. Then you have a different template and could create another site with this template.

opening this old thread once again…

But is there a chance to include 2 (!) forms on one page! So there is only one controller PHP-File -> home.php

But within the home-template there are two different forms…

yes you can query the submit button.
Put an if clause inside the main function like:

return function($site, $pages, $page) {
	$contactalert	= null;
	$contactsuccess = null;

	$inquiryalert	= null;
	$inquirysuccess = null;

    if(get('contactsubmit')) {
          $contactdata			= array(
    //Inquiry Form	
    elseif(get('submitinquiry')) {
 	return compact('contactalert', 'contactsuccess', 'inquiryalert', 'inquirysuccess');

Hope this helps.

After several tries it worked!! (no, im definitely no php expert!)

Thanks for your help, it was a great first sign!