Adding A+ variables to MP confirmation email

How can I refer to A+ variables (Start, End,...) in the MP confirmation email?

  • Amir
    • Site Builder, Child of Zeus

    Hakan in this post had made this code, which works great for the Admin. How can you change this for the paying person?

    function modify_admin_message( $msg, $order ) {
    global $appointments;
    $a = $appointments;
    if ( !is_object( $a ) )
    return $msg;
    // Find first appointment ID to get details
    foreach ( $order->mp_cart_info as $product_id=>$product_detail ) {
    foreach( $product_detail as $var ) {
    list( $product_name, $app_id ) = split( ':', $var['name'] );
    break 2;
    $r = $a->get_app( $app_id );
    if ( is_object( $r ) ) {
    $msg .= "
    Appointment details:
    $msg .= $a->_replace( $a->options["confirmation_message"], $r->name, $a->get_service_name($r->service), $a->get_worker_name($r->worker), $r->start, $r->price, $a->get_deposit($r->price), $r->phone, $r->note, $r->address, $r->email );
    return $msg;
    add_action( 'mp_order_notification_admin_msg', 'modify_admin_message', 10, 2 );
  • Jonathan
    • The Bug Hunter

    Hi @Amir,

    You'll want to use the mp_order_notification_body hook. Looks like the following in the source code:

    $msg = apply_filters('mp_order_notification_body', $this->filter_email($order, stripslashes($this->get_setting('email->new_order_txt'))), $order);

    Let me know if that works for you. :slight_smile:

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.