• Resolved ajay paudel

    (@ajay-paudel)


    When A user For the first time, tried to book then, we have added customer id in the note field of customer menu of Amelia in admin area and for notification we have setup the text of mail and we have added %customer_note% in mail but for the first time that note field value is not being displaying or display empty and we added the customer id by using below code:

    `function amelia_booking_added_hook($reservation, $bookings, $container) {
    global $wpdb;
    $id = $bookings[0][‘customerId’]; //1000
    $customerNote = $wpdb->get_var(
    “SELECT note FROM wp_amelia_users WHERE id = $id”
    ) ?: ”;
    $customerWpId = $wpdb->get_var(
    “SELECT externalId FROM wp_amelia_users WHERE id = $id”
    );
    $userId1000 = get_user_meta( intval($customerWpId), ‘user_id_1000’, true);
    $nowDateTime = new \DateTime(‘now’);
    //if (empty($customerNote)) {
    $customerNote = $userId1000 . PHP_EOL;
    //}

    $wpdb->update(‘wp_amelia_users’, [‘note’ => $customerNote], [‘id’ => $id]);
    }
    add_action(‘AmeliaBookingAdded’, ‘amelia_booking_added_hook’, 10, 3);`

    we have attached that note field value by using %customer_note% short code code in mail setup or notification setup but for the first time if user or customer book then in mail note field value is not coming or is not displaying

Viewing 1 replies (of 1 total)
  • Plugin Author ameliabooking

    (@ameliabooking)

    Hello there.

    We will be glad to help, however, please note that this forum’s rules do not allow us to provide assistance for the full version of the plugin, so if you’re having issues with the update of the full version, we will not be able to help you with it, but you can open a ticket on our official support platform, and our support managers will gladly assist you there.

    Kind regards.`

Viewing 1 replies (of 1 total)

The topic ‘Sending First Time Mail Issue’ is closed to new replies.