我正在尝试弄清楚如何在更新时发送电子邮件。
<?php
function my_mail_function(){
$to = "rma@mysite.net";
$subject = "RMA Update Completed";
$values2 = $row['rma_submissions.paid'];
$message = "
<html>
<head>
<title>RMA Update Complete</title>
</head>
<body>
<p>This is a copy of your RMA Update Request</p>
<table>
$values2
<tr><td>Completed?: <b> Yes </b></td></tr>
</table>
</body>
</html>
";
// Always set content-type when sending HTML email
$headers = "MIME-Version: 1.0" . "\r\n";
$headers .= "Content-type:text/html;charset=UTF-8" . "\r\n";
// More headers
$headers .= 'From: <noreply@mysite.net>' . "\r\n";
mail($to,$subject,$message,$headers);
}
include( "lib/DataTables.php" );
use
DataTables\Editor,
DataTables\Editor\Field,
DataTables\Editor\Format,
DataTables\Editor\Mjoin,
DataTables\Editor\Options,
DataTables\Editor\Upload,
DataTables\Editor\Validate,
DataTables\Editor\ValidateOptions;
Editor::inst( $db, 'rma_submissions', 'ID' )
->fields(
Field::inst( 'rma_submissions.id' ),
Field::inst( 'rma_submissions.timestamp' )
->validator( Validate::dateFormat( 'Y-m-d H:i:s' ) )
->getFormatter( Format::datetime( 'Y-m-d H:i:s', 'Y-m-d H:i:s' ) )
->setFormatter( Format::datetime( 'Y-m-d H:i:s', 'Y-m-d H:i:s' ) ),
Field::inst( 'rma_submissions.location' ),
Field::inst( 'rma_submissions.orig_invoice' ),
Field::inst( 'rma_submissions.all_accessories' ),
Field::inst( 'rma_submissions.new_submission' ),
Field::inst( 'rma_submissions.man_sku' ),
Field::inst( 'rma_submissions.device_id' ),
Field::inst( 'rma_submissions.failure_desc' ),
Field::inst( 'rma_submissions.defective_oob' ),
Field::inst( 'rma_submissions.original_sales_date' ),
上面的方法不能正常工作。它发送电子邮件,但在前端出错,并且也不包含变量信息。
如果我只添加文本,它发送得很好,但是当我添加任何变量时,它会出错。这一定是我提取变量的方式上的错误。
拉丁的传说