TripIt Skill
Add travel plans to TripIt by sending structured confirmation emails to plans@tripit.com. No API keys required — just email sending capability.
How It Works
TripIt parses specially formatted emails ("TripIt Approved" format) into travel objects. This skill generates those emails; you send them with whatever email tool you have (MS Graph, Himalaya, gog, etc.).
Flow:
- 1. User says "add my flight to TripIt"
- You construct JSON from their details
- INLINECODE1 generates the formatted email body
- You send it to INLINECODE2
- TripIt creates the trip object within seconds
Setup
The sender email must be associated with the user's TripIt account. Either:
- - The email is the one they signed up with, OR
- They've added it at TripIt → Settings → Connected Email Addresses
No other configuration needed.
Usage
Generate a flight confirmation
CODEBLOCK0
Generate a hotel confirmation
CODEBLOCK1
Generate an activity
CODEBLOCK2
Generate a multi-item email
CODEBLOCK3
Include a subject line
Add --subject to any command to get a suggested email subject:
CODEBLOCK4
Sending the Email
The script outputs the email body. You send it using whatever email tool is available.
MS Graph (Microsoft 365 users)
CODEBLOCK5
Himalaya
CODEBLOCK6
gog (Google OAuth)
CODEBLOCK7
Field Reference
See references/template-format.md for the complete field list for each object type, including required vs optional fields and formatting rules.
Supported Object Types
| Type | Command | Key Required Fields |
|---|
| Flight | INLINECODE4 | airline, flightnumber, departure/arrival airport+date+time |
| Hotel |
hotel | hotelname, checkin
date, checkoutdate |
| Activity |
activity | activity
name, startdate |
| Car Rental |
car | rental
company, pickupdate, dropoff_date |
| Rail |
rail | carrier, departure/arrival date+time |
| Multiple |
multi | Each item needs
type + that type's required fields |
Verifying Items Landed
After sending an email, confirm TripIt processed it by fetching the user's iCal feed:
- 1. The user provides their TripIt iCal URL (found at TripIt → Settings → Calendar Feed), e.g.:
https://www.tripit.com/feed/ical/private/<hash>/tripit.ics
- 2. Fetch the feed and look for the newly added item (match on confirmation number, dates, or summary text)
- If the item doesn't appear after ~60 seconds, check:
- Was the sender email linked to the TripIt account?
- Was the email sent as plain text (not HTML)?
- Were all required fields present?
CODEBLOCK8
Tip: Store the user's iCal feed URL so you can verify future sends without asking again. The URL is stable — it doesn't change unless the user regenerates it.
Gotchas
- - Date format consistency: Use one format per email (ISO 8601 recommended:
2026-03-15) - Sender email must be linked: TripIt ignores emails from unrecognized addresses
- Plain text only: Send as plain text, not HTML
- Multi-line fields: End with
*** on its own line (e.g., long notes or cancellation policies) - Processing time: TripIt usually processes within seconds, occasionally up to a few minutes
- Duplicates: TripIt deduplicates by confirmation number — re-sending updates the existing entry
- Field labels matter: TripIt's parser is strict about label names. This script uses the exact labels from TripIt's official vendor templates. Don't hand-craft emails with different labels (e.g., "Confirmation Number" won't work — it must be "Booking confirmation #")
TripIt 技能
通过将结构化的确认邮件发送至 plans@tripit.com,将旅行计划添加到 TripIt。无需 API 密钥——只需具备邮件发送能力即可。
工作原理
TripIt 会将特殊格式的邮件(TripIt 认可格式)解析为旅行对象。本技能生成这些邮件;您可以使用任何可用的邮件工具(MS Graph、Himalaya、gog 等)发送它们。
流程:
- 1. 用户说将我的航班添加到 TripIt
- 您根据其详细信息构建 JSON
- tripit-email.py 生成格式化邮件正文
- 您将其发送至 plans@tripit.com
- TripIt 在几秒内创建旅行对象
设置
发件人邮箱必须与用户的 TripIt 账户关联。可以是:
- - 用户注册时使用的邮箱,或者
- 用户在 TripIt → 设置 → 已关联邮箱地址 中添加的邮箱
无需其他配置。
使用方法
生成航班确认信息
bash
echo {airline:美联航,flight_number:1234,class:经济舱,
departurecity:旧金山,departureairport:SFO,
departuredate:2025-06-15,departuretime:08:30,
arrivalcity:纽约,arrivalairport:JFK,
arrivaldate:2025-06-15,arrivaltime:17:05,
passenger:简·史密斯,confirmation:UA1234X,
bookingsiteurl:https://www.united.com} \
| python3 scripts/tripit-email.py flight
生成酒店确认信息
bash
echo {hotelname:纳帕谷水疗酒店,checkindate:2025-06-15,
checkout_date:2025-06-18,city:纳帕,state:CA,country:US,
street_address:葡萄园巷123号,confirmation:NV8842,
numberofguests:2,rate:189.00,currency:USD} \
| python3 scripts/tripit-email.py hotel
生成活动信息
bash
echo {activity_name:品酒之旅,location:索诺玛谷葡萄园,
startdate:2025-06-16,starttime:10:00,
enddate:2025-06-16,endtime:14:00,
city:索诺玛,state:CA,country:US} \
| python3 scripts/tripit-email.py activity
生成多项目邮件
bash
echo {items:[
{type:flight,airline:美联航,flight_number:1234,
departurecity:旧金山,departureairport:SFO,
departuredate:2025-06-15,departuretime:08:30,
arrivalcity:纽约,arrivalairport:JFK,
arrivaldate:2025-06-15,arrivaltime:17:05,
passenger:简·史密斯,confirmation:UA1234X},
{type:hotel,hotelname:曼哈顿大酒店,checkindate:2025-06-15,
checkout_date:2025-06-18,city:纽约,state:NY,country:US,
confirmation:MG7890}
]} \
| python3 scripts/tripit-email.py multi
包含主题行
在任何命令后添加 --subject 以获取建议的邮件主题:
bash
echo ... | python3 scripts/tripit-email.py --subject flight
发送邮件
脚本输出邮件正文。您可以使用任何可用的邮件工具发送。
MS Graph(Microsoft 365 用户)
bash
BODY=$(echo ... | python3 scripts/tripit-email.py flight)
使用您的 MS Graph 邮件发送工具发送:
收件人:plans@tripit.com
主题:美联航 SFO-JFK 2025-06-15
正文:$BODY(纯文本)
Himalaya
bash
echo ... | python3 scripts/tripit-email.py --subject flight > /tmp/tripit-email.txt
himalaya send --to plans@tripit.com \
--subject $(head -1 /tmp/tripit-email.txt | sed s/Subject: //) \
--body $(tail -n +3 /tmp/tripit-email.txt)
gog(Google OAuth)
bash
BODY=$(echo ... | python3 scripts/tripit-email.py flight)
gog send --to plans@tripit.com --subject 航班确认 --body $BODY
字段参考
请参阅 references/template-format.md 获取每种对象类型的完整字段列表,包括必填字段与可选字段以及格式规则。
支持的对象类型
| 类型 | 命令 | 关键必填字段 |
|---|
| 航班 | flight | 航空公司、航班号、出发/到达机场+日期+时间 |
| 酒店 |
hotel | 酒店名称、入住日期、退房日期 |
| 活动 | activity | 活动名称、开始日期 |
| 租车 | car | 租车公司、取车日期、还车日期 |
| 铁路 | rail | 承运商、出发/到达日期+时间 |
| 多项 | multi | 每个项目需要 type + 该类型的必填字段 |
验证项目是否成功添加
发送邮件后,通过获取用户的 iCal 订阅源 确认 TripIt 已处理:
- 1. 用户提供其 TripIt iCal URL(位于 TripIt → 设置 → 日历订阅源),例如:
https://www.tripit.com/feed/ical/private/
/tripit.ics
- 2. 获取订阅源并查找新添加的项目(通过确认号、日期或摘要文本匹配)
- 如果约 60 秒后项目仍未出现,请检查:
- 发件人邮箱是否已关联到 TripIt 账户?
- 邮件是否以纯文本(而非 HTML)发送?
- 是否包含所有必填字段?
bash
获取订阅源并搜索确认号
curl -s https://www.tripit.com/feed/ical/private//tripit.ics \
| grep -A5 UA1234X
提示: 保存用户的 iCal 订阅源 URL,以便在无需再次询问的情况下验证未来的发送。该 URL 是稳定的——除非用户重新生成,否则不会更改。
注意事项
- - 日期格式一致性:每封邮件使用一种格式(推荐 ISO 8601:2026-03-15)
- 发件人邮箱必须关联:TripIt 会忽略来自未识别地址的邮件
- 仅限纯文本:以纯文本而非 HTML 发送
- 多行字段:以单独一行的 结尾(例如,长篇备注或取消政策)
- 处理时间:TripIt 通常在几秒内处理,偶尔需要几分钟
- 重复项:TripIt 通过确认号去重——重新发送会更新现有条目
- 字段标签很重要*:TripIt 的解析器对标签名称要求严格。本脚本使用 TripIt 官方供应商模板中的确切标签。请勿使用不同标签手动编写邮件(例如,确认号无效——必须是预订确认编号)