I have a contact form which posts to mailchimp – but in certain cases, I also want it to send out an email.
I considered changing the <form action="... from mailchimp to my own page, containing something similar to the following:
<form action="mailchimp_url..." ...>
<? foreach($_POST as $name=>$value){?>
<input type="hidden" name="<? echo $name;?>" value="<? echo $value;?>">
<? }?>
<? //mail the stuff I want somewhere else ?>
I could then just auto execute this on pageload with javaScript.
The Problem is, IF this works, it will be dependant on JavaScript, or will require an additional button click for the user.
Is there a more elegant way to do this?
You can post to your own server first
Then use cURL to post the same data to mailchimp
Here is a good example on how to