email - 电子邮件中缺少“$template”参数
问题描述
我正在尝试在我们的 IPN 发送付款状态更新后发送电子邮件,并同时向客户发送电子邮件。我有以下代码
$file_attachement = null;
Mail::Send( (int)$email_order->id_lang,
'order_conf',
Mail::l('Order confirmation', (int)$email_order->id_lang),
null,
$email_customer->email,
$email_customer->firstname.' '.$email_customer->lastname,
null,
null,
$file_attachement,
null,
_PS_MAIL_DIR_, false, (int)$email_order->id_shop );
我收到以下错误
Missing '$template' parameter...smarty_internal_templatebase.php on line 177
存在,order_conf
我可以查看Advanced Parameters->Email
并看到它正在尝试发送。
Prestashop 版本是 1.7.5.1
解决方案
邮件是模板化的。您必须为模板机制传递数据。
您的数据参数为空。
<?php
$file_attachement = null;
Mail::Send(
(int)$email_order->id_lang,
'order_conf',
Mail::l('Order confirmation', (int)$email_order->id_lang),
$YOUR_DATA_ARRAY_NOT_NULL,
$email_customer->email,
$email_customer->firstname.' '.$email_customer->lastname,
null,
null,
$file_attachement,
null,
_PS_MAIL_DIR_, false, (int)$email_order->id_shop );
?>
您可以从Prestashop 的源代码中了解如何获取这些数据
推荐阅读
- python - 从 tkinter 中删除多个标签
- ios - 如何使用启动故事板或 XIB?
- flutter - 更改从外部类返回的抽屉小部件的抽屉图标
- python - 如何使用假设检验来比较组
- java - 无法在 ajax 覆盖弹出窗口中单击或发送键,并使用 selenium 和 java 显示 Element not Intractable 异常
- react-native - [未处理的承诺拒绝:TypeError:_reactNative.NativeModules.RNDatePickerAndroid.dismiss 不是函数
- python - 在postgresql表django中插入数据
- php - 如何保存函数的结果
- javascript - Fabric.js 逐像素操作 Image 对象以改变颜色
- c - C语言中的语法错误