Trial Requests
1. Request Overview
Trial requests are submitted by potential customers through the public trial form and processed into subscriptions.
Fields
- Name - Contact name (required, tracked)
- Company Name - Customer's company (required, tracked)
- Email - Contact email (required, tracked)
- Mobile - Contact mobile number (required, tracked)
- Company Size - Employee count range (required, tracked):
1-5,6-10,11-30,30-100,100+
- Trial Package - Associated trial package (required, tracked)
- Partner - Auto-created customer partner record (tracked)
- Subscription - Created subscription (tracked)
- Database Template - Database template override (optional)
- State - Request status (tracked):
New- Pending processingProcessing- Subscription being createdDone- Subscription created successfullyCancelled- Request cancelled
- Notes - Internal notes
2. Request Lifecycle
New → Processing → Done ↓ Cancelled → New (reset)
3. Actions
| Action | Description |
|---|---|
| Create Subscription | Manually create a subscription from this request |
| Cancel | Cancel the request |
| Reset to New | Reset a cancelled request back to New |
| View Subscription | Open the related subscription |
| View Partner | Open the related customer partner |
4. Automatic Processing
When a request is created and the trial package has Auto Run Subscription enabled:
- A
res.partnerrecord is created (or linked if email already exists) - A
sadeem.subscriptionrecord is created with:- Customer = created partner
- Packages = from trial package
- User/storage/stage limits = from trial package
- Trial duration and grace period
is_trial = Trueflag- Model limits (if configured)
- The subscription is confirmed and queued for deployment
Duplicate Prevention
Each email + trial package combination is unique. Submitting the same email for the same package will be rejected.
5. Email Verification (OTP)
A trial request is not created straight from the public form. The visitor first proves they own the email address.
Flow
sequenceDiagram
participant V as Visitor
participant W as Website
participant O as sadeem.subscription.trial.otp
participant R as Trial Request
V->>W: POST /saas/trial/submit (form data)
W->>O: Create pending verification + email a 6-digit code
W-->>V: Code entry page (masked email)
V->>W: POST /saas/trial/verify (token + code)
W->>O: Hash and compare, check expiry
O->>R: Create the trial request with the stored form data
W-->>V: Confirmation page
| Route | Purpose |
|---|---|
/saas/trial , /saas/trial/<url_string> |
Public trial form |
/saas/trial/submit |
Stores the form data on a pending verification and sends the first code |
/saas/trial/verify |
Validates the submitted code and creates the trial request |
/saas/trial/resend |
Sends a fresh code for the same verification |
The `sadeem.subscription.trial.otp` Model
- Contact Name, Company Name, Email, Mobile, Company Size, Trial Package - The pending form data, copied to the trial request once verified
- Access Token - Random hex token identifying the verification in the URL / form
- Code Hash - SHA-256 of
access_token + code; the plaintext code is never stored - Code Expiry - Timestamp after which the code is refused
- Failed Attempts, Codes Sent, Last Code Sent - Rate-limit counters
- State -
Pending,VerifiedorCancelled - IP Address - Used for per-IP rate limiting
- Trial Request - Set once the verification produced a request
Limits
| Limit | Value |
|---|---|
| Code validity | 10 minutes |
| Failed attempts per verification | 5 |
| Codes sent per verification | 3 |
| Resend cooldown | 60 seconds |
| Verifications per email per hour | 3 |
| Verifications per IP per hour | 10 |
One live verification per email + package
Starting a new verification cancels the other pending verifications for the same email and trial package, so an old code cannot be reused.
The code is delivered by the Trial OTP mail template (sadeem_subscription_trial.mail_template_trial_otp), sent immediately with force_send=True. If mail delivery is broken the visitor sees the failure at submit time rather than silently never receiving a code.