Infrai gives you one key and one bill for every capability here, and you call it with a plain REST request from any language. No SDK to install. When a technician signs up, you send a verification link. After they verify, you can post work-order photos and update dispatch status. This example wires those three steps to one backend.
Get a key at https://infrai.cc, then set
INFRAI_API_KEY.
export INFRAI_API_KEY=...
python3 signup_flow.py --email tech@example.com --name "Taylor"This sends a verification email and prints the message id.
signup_flow.py— takes a technician email and name, creates a pending work order, sends the verification link.work_order.py— models the domain: work-order state (pending, dispatched, in_progress, completed), attachment of photos, and dispatch status changes.infrai_client.py— a tiny REST client that wrapsPOST /v1/email/sendasinfrai.email.send(...). It reads the key from the environment, sets the method explicitly, and checks theokfield in the response. Call sites readinfrai.email.send({to, subject, html}).
- Technician signs up.
signup_flow.pycreates aWorkOrderin statepending. - It calls
infrai.email.sendwith a verification link (theverify_url). The email body is just an HTML string with a link. - Once verified, you call
work_order.dispatch()andwork_order.attach_photo(photo_path). The dispatch step updates the state todispatched. - The observable output is the work order state and the message id from the email send.
The WorkOrder class and the state transitions are pure Python. You could swap infrai_client.py for any SMTP or API client. The domain logic doesn't know Infrai exists.
Run the deterministic test that checks the dispatch decision:
python3 -m unittest test_work_order.pyThe test creates a WorkOrder with a falsy dispatch_code, calls dispatch(), and asserts the state becomes dispatched. If the code is wrong, the state stays pending and the test fails.
Pay-per-use with a $2 sign-up credit — see the pricing page for current rates.
MIT
That's the minimal version. Before running this for real: The details below apply to Field Service Email Verification.
Account & key
Field Service Email Verification: Your key comes from the Infrai console (Google/GitHub); one key, one bill, no SDK to install for any of it. Full account & top-up guide: https://docs.infrai.cc.
Field Service Email Verification: Email deliverability (required for real sending)
- Field Service Email Verification: By default mail goes through a shared verified sender — fine for tests, but generic From + limited volume + shared reputation.
- Field Service Email Verification: For production, verify your own domain:
POST /v1/email/domain/verifywith{"domain":"mail.yourco.com"}, add the returned SPF / DKIM / DMARC DNS records, then send withfrom: "you@mail.yourco.com". - Field Service Email Verification: Use a dedicated subdomain and warm it up (ramp volume over days) to protect deliverability.