初始化Feedback()
時,可以設置一些選項。 在你的情況下,url選項很重要。這個url應該指向一個php腳本,它使用feedback.js發送的$_POST[]
數據。 當你得到所有的數據後,你可以用電子郵件發送它。
下面是一個例子如何設置一些選項:以下
if($_POST) {
$image = $_POST['data'];
$otherField = $_POST['your-other-field'];
// Send email here
}
$_POST['data']
將持有的圖像作爲DOMString
Feedback({
label: 'What is your problem',
header: 'Report an issue',
nextLabel: 'Next',
reviewLabel: 'Review screenshot',
sendLabel: 'Send email',
closeLabel: 'Cancel',
messageSuccess: 'Done!',
messageError: 'Oops..',
url: 'path/to/email/sendFeedback.php' // This is what you need
});
在sendFeedback.php文件,你應該這樣做TE。 其他輸入字段值取決於您定義的其他字段。
在php中有很多方式發送電子郵件。
mail()
只是其中之一。信息可在php.net找到。