User Based Pricing Scripts
This page contains the available variables and example algorithms using User Based Pricing Scripts.
To see how Pricing Scripts work, read General Rules for Pricing Scripts .
User Based Pricing is supported throughout the entire ordering processes. This allows your service to customize pricing based on specific roles within the organization.
Available Variables
Variable | Description |
---|---|
| Full name of the user |
| Email address of the user |
| The domain of the current site |
| Number of the customer |
| The country which is assigned in the address. Example: DE for Germany |
| User language |
Example Use Cases
Syntax | Meaning | Examples |
| Determines whether a user email address includes a specific phrase |
is true for user@3yourmind.com, user@3yourmind.de, 3yourmind@mail.com |
| Determines whether a user email address starts with a specific phrase |
is true for user@3yourmind.com, user@3yd.de, false for test.user@3yourmind.com |
| Checks if user email address ends with a specific phrase |
is true for user@3yourmind.com, but false for user@3yourmind.de |
| Compares if user email matches a regular expression |
|
Sample User Pricing
Offer a 10% discount if the email address ends with “@3yourmind.com“
let price = model.volume * 0.0002;
if (user.email && user.email.endsWith("@3yourmind.com")) {
price = 0.9 * price;
}
price; // Last line contains the final price