【问题标题】:Wordpress wp-ecommerce, Test Gateway, send email to admin tooWordpress wp-ecommerce,测试网关,也向管理员发送电子邮件
【发布时间】:2011-12-21 03:19:55
【问题描述】:

我的客户不想接受在线支付,只需通过电子邮件发送订单详细信息,因此我使用了测试网关。它只是向买家发送电子邮件,我也需要它发送到管理员的电子邮件。

这是插件的代码:

$email = wpsc_get_buyers_email($purchase_log['id']);

我尝试将其设为数组,但它会引发错误并且不起作用。我没有很多php经验!

$email = array (wpsc_get_buyers_email($purchase_log['id']), 'myemail@email.com');

有什么帮助吗?

【问题讨论】:

    标签: php arrays wordpress email


    【解决方案1】:

    我只是在寻找相同的内容,但在任何地方都找不到简单的答案。我知道这个话题很老了,但这个解决方案应该很有帮助。

    在我编辑的 WP-Ecommerce 中:

    wpsc-theme/functions/wpsc-transaction_results_functions.php

    我刚刚添加了商家idealcheckoutideal(可以是任何商家)以及触发通知电子邮件的功能。我猜你可以在任何地方调用这些函数,只要你使用purchase_log 参数。

    if ( $selected_gateway ) {
            switch( $selected_gateway ){
                case 'anymerchant you want':
    
                    if ( ! isset( $_REQUEST['sessionid'] ) )
                          return;
    
    
                    $purchase_log = new WPSC_Purchase_Log( $_REQUEST['sessionid'], 'sessionid' );
                    wpsc_send_admin_email($purchase_log); 
                    wpsc_send_customer_email($purchase_log);               
    
                break;
    

    【讨论】:

      【解决方案2】:

      如果您使用的是 wp-ecomemrce 插件,那么您不必编辑任何代码,管理员电子邮件地址将收到新订单的电子邮件。查看一下 wordpress 中的后端设置,您可能已经关闭了一个设置。

      【讨论】:

      • 你是对的!愚蠢的错误,我忽略了商店管理部分的一部分,认为它是关于下载的。愚蠢的。谢谢!
      【解决方案3】:

      它是如何发送邮件的?是使用php的mail()还是wp_mail()。如果它使用 php 的 mail(),您应该将 $email 变量以逗号分隔,而不是作为数组发送。 (如果是他们的自定义滚轮,也可以尝试发送以逗号分隔的地址)

      【讨论】:

      • 我尝试用逗号分隔,减去这样的数组标签:$email = wpsc_get_buyers_email($purchase_log['id']), 'sarah@amperandsand.com';发送电子邮件的代码是(我认为): if ( !get_transient( "{$sessionid}_pending_email_sent" ) ) { wp_mail( $email, __( 'Order Pending: Angela Fashion', 'wpsc' ), $message ) ; set_transient("{$sessionid}_pending_email_sent", true, 60 * 60 * 12); }
      • - 这给了我错误并破坏了网站:解析错误:语法错误,意外','在/homepages/16/d392665558/htdocs/testing/wp-content/plugins/wp-e -commerce/wpsc-theme/functions/wpsc-transaction_results_functions.php 第 144 行
      猜你喜欢
      • 2010-11-27
      • 2013-11-12
      • 1970-01-01
      • 2011-03-17
      • 1970-01-01
      • 2016-01-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多