2014-09-13 83 views
-1

我有一個向Salesforce提交信息的表單。當我點擊提交按鈕時,我想觸發一個填寫了表單信息的電子郵件。如何在提交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="[email protected]"> --> 
<!-- ---------------------------------------------------------------------- --> 

<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> 

回答

1

聽起來你最好的選擇可能是創建一個處理頁面,該頁面提供將表單信息發送到SalesForce頁面以及發送電子郵件的功能,而不是直接將您的信息發送到SalesForce。

0

在PHP中,POST數據可通過$_POST superglobal獲得。 您的first_name輸入內容將在$_POST['first_name']中找到。

現在用PHP發送一封郵件,如果你的服務器配置正確,你需要的是mail()函數。

+0

@Sebastian我不會將數據發佈到同一頁面,因爲action =「<?php echo $ _SERVER ['PHP_SELF']?> – Muk 2014-09-14 06:00:25

+0

POST數據將可用於發佈表單的頁面,即在action屬性中定義(在你的例子中:'https:// www.salesforce.com/servlet/servlet.WebToLead') – 2014-09-14 11:12:01

+0

@Sebastian我無法訪問https://www.salesforce.com/servlet/servlet .WebToLead – Muk 2014-09-14 14:08:22

相關問題