Skip to content

Instantly share code, notes, and snippets.

@paran01d
Created September 8, 2020 23:27
Show Gist options
  • Save paran01d/9d38d908731b1c5e7ba84d87d53246bb to your computer and use it in GitHub Desktop.
Save paran01d/9d38d908731b1c5e7ba84d87d53246bb to your computer and use it in GitHub Desktop.
Sendsei Admin Feature Review
<title>Sendsei Admin Feature Review</title>

Sendsei Admin Feature Review

Main Sections

Admins

Admins allows access to houston, this is CRUD for the users table with id_admin set to true.

Forest Admin

This is the standard forest admin user accounts. Further to Houston, different teams can be created with different roles and permissions. Users can be set to admin for use in sendsei via the users collections records and the is_admin toggle.

Account

This section is for listing existing sendsei accounts. Accounts cannot be created as they need at least one user and a billing record. Accounts are created by creating a user with an account that doesnt exist.

Viewing accounts leads you to a view of the record with:

  • Details
  • Daily Message Limit
  • Features
  • Credit/Debit
  • Account Overdraft
  • Routing Table
  • Message Price
    Editing an account allows you to change the basic Details and the Message limit, this just updates the account document.

Toggling Parent/Child, allows you to set a mandatory subdomain name for the account and updates the account document, this is not allowed if the account is already a child of another account.

Credit/Debit allows a manual billing transaction to made against this account. It calls the buu methods add> ToBalance and RemoveFromBalance if there is enough credit on the account. But methods can trigger notifications.

Account Overdraft allows toggling of an account overdraft and the amount of the overdraft. This sets the overdraft field on the accounts billing document.

Routing Table allows to overwrite sms routes for this account, it creates/removes sms_route documents with account_id tied to this account.

Message Price allows overriding sms/mms pricing via cruding sms_price documents with the account_id tied to this account.

Forest Admin

Accounts show up in forest admin and have hyperlinks to the parent accounts and owner users. Accounts can be created from here, though they will have none of the extra parts created. Creating an account will allow you to choose or create a user for the ownerId. A Smart Route will be needed here to call the sendsei admin api to perform the other account setup features.

There is no way of searching for an account based on user details. It is possible to extend forest admin to allow CRUD of related users via the Smart Relationship feature

Parent/Child can only be done presently by editing the JSON to enable accounts and adding them to the accounts array. This could be improved with custom Smart Views work allowing us to create a widget to do this.

Overdraft is not part of the account view and instead is available in the new billing collection as a toggle and amount. This can be improved by creating a new custom Smart Relationship which will show billing records alongside account details.

Routing Table does not show up in the Accounts view and instead is shown as a seperate collection in the forest menu. It will show all accounts and the global ones, but the account id is hyperlinked and when created can be searched. Again this can be improved by creating a new custom Smart Relationship which will show and create associated routes alongside account details

Message Price does not show up in the Accounts view and instead is shown as a seperate collection in the forest menu. It will show all accounts and the global ones, but the account id is hyperlinked and when created can be searched. Again this can be improved by creating a new custom Smart Relationship which will show and create associated Pricings alongside account details. Also the pricing will need a smart view to avoid having to edit a the JSON object directly

Users

Users are sendsei users that can login to the system. From here users can be created, editied and deleted. Create User is a special case in that if the account chosen does not exist, then it and its dependencies are created and this user is set as the account owner.

There is also a function to allow you to login as this user. This will create a special login token for sendsei and log you into that users account on sendsei.

Edit allows you to change an account details, which updates the User document.

Delete sets the account status to deleted.

Forest Admin

Users show in forest admin in the Users Collection. Because users can belong to multiple accounts, forest admin gets a bit confused so a custom smart relationship will need to be setup to show the relationship between users and accounts (though you can see users of an account via the account collection). Editing a document is fine.’
Delete will remove the document, though an admin can set the status and deleted date via edit to mimic current delete behaviour.

Creating users will just create the user record and it doesn’t link a user to an account nor does it set the password hash correctly. A custom create method will need to added to forest to do this.

Login as user will have to be a custom smart action.

MessagePricing

This section sets the global pricing for sms and mms pricing docs. It is the mms_price and sms_price documents with an account_id of 0. When an account id is created this record is cloned with the account_id, so that prices can be overriden on an account by account basis.
This is just CRUD for those records.

Forest Admin

This is available as the MMS/SMS prices collections via CRUD, it provides a json field to edit the pricing document. It also includes all prices not just the global ones.

The json field is certainly not the easiest way to edit/manipulate this data but making it easier to use will require a custom smart view to be created.

Campaign

This section is used to Validate account campaign sends, campaigns can be Approved and are then sent or can be rejected and do not get sent. This is done via buu methods.

Forest Admin

This is available via the Campaign collection, which shows all campaigns. This campaigns to validate can be created as a Segment by searching on the status field and this can be set as the default and only view.

The command to accept or reject a campaign will need to be implemented as a smart action.

Currency

This displays the values in the config.currency object.

Forest Admin

This is not available in forest admin as its hardcoded in a frontend config file and not used by the backend. We could create a backend call and a custom object to display this information ??..

Countries

This is CRUD for the countries document and is used to add different countries that accounts can belong too and that pricing can be assigned too in this countries currency.

Forest Admin

Thsi should be a simple auto generated CRUD page, but it fails for some reason so will need some investigation to get it working.

SenderIDs

This is CRUD for the sender document and allows assigning sender ids to accounts.

Forest Admin

This is available as CRUD from the senders collection. Only problem is it doesnt allow searching via account, so to get that functionality will require creating a relationship between Sender and Account and then senders will show up alongside account records.

Connections

This just displays the connections defined in the mms_connection and sms_connection documents respectively and are the targets that can be routed too by sms_route and mms_route.

Forest Admin

These are available from the MMS/SMS connections collections respectively they are just simple CRUD.
It is possible to add a relationship to the routes so that one can tell which routes are connected to which connection.

Routing

This section allows setting up the global routing tables, if an account does not have a specific route set it will fall back to here. It is CRUD for the mms_route and sms_route documents with an account_id of 0.

Forest Admin

These are available from the MMS/SMS route collections. They show the individual account overrides as well as the global routes. It is simple CRUD.

It could be improved by setting up a realtionship between the provider keys fields and the connections collection. Which forest didnt pick up automagically.

Invoices

This section is for the management of invoices for post paid accounts.

Forest Admin

This is available from the invoices collection.

It will need segments setting up to represent the different tabs. It will need a smart view for the invoice generation and custom smart actions for the send, regenerate, paid and cancel functions.

Contacts

Contacts displays a table of the all the contacts in the global_contact table.

Forest Admin

This is available from the cotacts globals table, it just needs configuring as read only.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment