我有一个表单,它将信息提交给Salesforce。我想在我点击提交按钮时触发包含表单中填写信息的电子邮件。
如何执行此操作还会提交该表单并触发电子邮件。
以下是表单代码。
<!-- ---------------------------------------------------------------------- -->
<!-- NOTE: Please add the following <META> element to your page <HEAD>. -->
<!-- If necessary, please modify the charset parameter to specify the -->
<!-- character set of your HTML page. -->
<!-- ---------------------------------------------------------------------- -->
<META HTTP-EQUIV="Content-type" CONTENT="text/html; charset=UTF-8">
<!-- ---------------------------------------------------------------------- -->
<!-- NOTE: Please add the following <FORM> element to your page. -->
<!-- ---------------------------------------------------------------------- -->
<form action="https://www.salesforce.com/servlet/servlet.WebToLead?encoding=UTF-8" method="POST">
<input type=hidden name="oid" value="somevalue">
<input type=hidden name="retURL" value="http://example.com">
<!-- ---------------------------------------------------------------------- -->
<!-- NOTE: These fields are optional debugging elements. Please uncomment -->
<!-- these lines if you wish to test in debug mode. -->
<!-- <input type="hidden" name="debug" value=1> -->
<!-- <input type="hidden" name="debugEmail" value="developer@domain.com"> -->
<!-- ---------------------------------------------------------------------- -->
<label for="first_name">First Name</label><input id="first_name" maxlength="40" name="first_name" size="20" type="text" /><br>
<label for="last_name">Last Name</label><input id="last_name" maxlength="80" name="last_name" size="20" type="text" /><br>
<label for="email">Email</label><input id="email" maxlength="80" name="email" size="20" type="text" /><br>
<input type="submit" name="submit">
</form>
答案 0 :(得分:1)
听起来您最好的选择可能是创建一个处理程序页面,该页面提供将表单信息发送到SalesForce页面以及发送电子邮件的功能,而不是直接将您的信息发送到SalesForce。
答案 1 :(得分:0)
在PHP中,POST数据可通过$_POST
superglobal获得。
您first_name
输入的内容可在$_POST['first_name']
中找到。
现在用PHP发送邮件,如果你的服务器配置正确,你需要的是mail()
功能。