def send_expired_bookings_to_beneficiary_email(beneficiary: User, bookings: list[Booking]) -> None:
    success = True
    (books_bookings, other_bookings) = _filter_books_bookings(bookings)
    if books_bookings:
        books_bookings_data = get_expired_bookings_to_beneficiary_data(beneficiary, books_bookings, booking_constants.BOOKS_BOOKINGS_AUTO_EXPIRY_DELAY.days)
        success &= mails.send(recipients=[beneficiary.email], data=books_bookings_data)
    if other_bookings:
        other_bookings_data = get_expired_bookings_to_beneficiary_data(beneficiary, other_bookings, booking_constants.BOOKINGS_AUTO_EXPIRY_DELAY.days)
        success &= mails.send(recipients=[beneficiary.email], data=other_bookings_data)
    return success
def send_expired_bookings_to_beneficiary_email(beneficiary: User, bookings: list[Booking]) -> None:
    success = True
    (books_bookings, other_bookings) = _filter_books_bookings(bookings)
    if books_bookings:
        books_bookings_data = get_expired_bookings_to_beneficiary_data(beneficiary, books_bookings, booking_constants.BOOKS_BOOKINGS_AUTO_EXPIRY_DELAY.days)
        success &= mails.send(recipients=[beneficiary.email], data=books_bookings_data)
    if other_bookings:
        other_bookings_data = get_expired_bookings_to_beneficiary_data(beneficiary, other_bookings, booking_constants.BOOKINGS_AUTO_EXPIRY_DELAY.days)
        success &= mails.send(recipients=[beneficiary.email], data=other_bookings_data)
    return success