> ## Documentation Index
> Fetch the complete documentation index at: https://docs.swiftlywp.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Gift Messages

> Let customers add personal gift messages to their boxes.

BoxBuilder includes a built-in gift message feature. When enabled, customers can type a personal message that's stored with the order and shown in confirmation emails.

## Enable Gift Messages

Gift messages are controlled globally in **BoxBuilder → Settings → Gift Message** tab.

| Setting                 | Description                                           | Default                     |
| ----------------------- | ----------------------------------------------------- | --------------------------- |
| **Enable Gift Message** | Show the gift message field in the box builder        | Enabled                     |
| **Required**            | Make the gift message mandatory before adding to cart | No                          |
| **Label**               | The label shown above the text field                  | "Gift Message"              |
| **Placeholder**         | Placeholder text inside the field                     | "Add a personal message..." |
| **Max Length**          | Maximum number of characters allowed                  | 500                         |

## How It Works

1. Customer sees a text field in the box builder (below the box summary)
2. They type their personal message
3. When the box is added to cart, the message is stored with the cart item
4. At checkout, the message is saved as order item meta
5. The message appears in:
   * Order confirmation page
   * Order confirmation email
   * Admin order screen (**WooCommerce → Orders → Edit Order**)
   * Customer's **My Account → Orders** history

## Customizing the Label

You can change the gift message label and placeholder text in **BoxBuilder → Settings → Labels** tab, or in the **Gift Message** tab for the specific label and placeholder.

## Where the Message Appears

| Location                              | Visible To      |
| ------------------------------------- | --------------- |
| Cart page                             | Customer        |
| Checkout page                         | Customer        |
| Order confirmation page               | Customer        |
| Order confirmation email              | Customer        |
| Admin order screen                    | Store admin     |
| Packing slip (with compatible plugin) | Warehouse staff |

<Tip>
  The gift message is stored as WooCommerce order item meta (`_boxbuilder_message`), so it's accessible to any plugin that reads order item meta — including packing slip and PDF invoice plugins.
</Tip>

## Developer: Accessing the Gift Message

```php theme={null}
// Get gift message from an order item
$message = $item->get_meta( '_boxbuilder_message' );

// Filter the gift message before saving
add_filter( 'boxbuilder/gift_message', function( $message, $box_id ) {
    // Modify or validate the message
    return $message;
}, 10, 2 );
```
