# Documentation
SHARED ON CODELIST.CC

## Introduction

Start your own SaaS platform with Zender!

Attract online marketers and businesses who are looking for a cost-effective way of sending sms to their clients, with Zender they can do it with ease.

We know how important it is to have an easy to use platform for web masters, that's why Zender was built with ease of usage in mind.

Own it like you made it, with our full white-label platform solution, no one will know that your platform is using Zender!

Zender is a complete platform for starting a SaaS, we've carefully added all the important features to help you grow and earn. It even surpassed all the features of current sms gateway scripts on codecanyon!

## File Structure

Before installing Zender, please check if all the important directories and files are present in the "Script" folder on your downloaded zip from codecanyon. We want to make sure that you'll be able to install Zender without any problems.

We have our own MVC framework for building php scripts, as you might not know, most of the popular php frameworks today contains too much files and most of it are not even needed that makes the system bloated.

- system Contains the important core files of the system
  - configurations Contains the environment configurations
  - controllers Contains the app controllers
  - models Contains the database models
  - plugins Contains the framework plugins and custom libraries
  - storage Temporary cache data are stored here
  - framework.php The core file of the framework
- templates Contains the front-end template files
  - _apidoc Contains API documentaion template files (We are using apidocjs)
  - _assets Contains the overall frontend libraries (We hate repeating files)
  - _install Contains the installer template files (Must be deleted after installation)
  - _mail Contains the email template files
  - _scss Contains the scss stylesheets for theme customization
  - dashboard Contains the dashboard template files
  - default Contains the landing page template files
- uploads Contains system uploads
  - avatars Contains user avatar images
  - builder Contains the app builder files
- vendor Contains the composer dependencies
- .htaccess Mod rewrite rules
- index.php Request handler of the framework
- install.sql Installer SQL file

## Requirements

Please make sure that your server meets the following server & extension requirements.

- Apache >= 2.4
- PHP >= 7.1
- MySQL >= 5.6

- php-gd
- php-mbstring
- php-intl
- php-zip
- php-curl
- php-xmlreader
- php-bcmath

## Uploading

Download an ftp client to upload the files to your server. We recommend FileZilla for this.

If you have experience in linux, it's faster to upload the files using rsync.

Unzip the file you downloaded from codecanyon, you'll see 4 directories inside it. You will only need to upload the all contents of the Script folder.

Zender can be installed in the root directory or a sub-directory.

## Permissions

After uploading the files to your server, you should make sure that the required files has the permissions needed. The following directory and files must be writable, please chmod them to the required permissions.

- system Contains the important core files of the system
  - configurations
    - cc_env.inc 775 dont worry, this file is not accessible to public
    - cc_ver.inc 775 dont worry, this file is not accessible to public
  - storage 775 including sub-directories
- uploads 775 including sub-directories

Changing permissions of files can be done using FileZilla or cPanel file manager.

## Database

To install zender, you will need a database. If you haven't created yet, go to your cPanel and create a new database.

Set the database collation to utf8_general_ci for better character support.

This is an example of how it looks like on adminer:

If you don't have enough knowlegde on how to create a database on your server, please contact us using the contact form on our codecanyon profile here. We will assist you for free.

## Install

After uploading, changing of permissions and creating a mysql database, open your site url in the browser and you should be redirected to the install wizard:

### Installation Steps

- Enter your site name, we recommend this to be short from 3 to 10 characters with no spaces.
- Select your site protocol, choose HTTPS if your server has an ssl certificate and https compliant otherwise select HTTP. It is important that your properly set this to prevent issues connecting to our server.
- Enter your site description, be descriptive to boost your site's SEO effectivity.
- Enter your database hostname, database name, database username and database user password
- Enter your full name, preffered admin username and password. The first user is automatically set as super admin and cannot be deleted from system. User roles is already planned to be added on the next update, please view the zender official roadmap on the community forums for more info.
- When you're done filling up the required fields, click the Install Zender button.
- It should take less than a minute to install the database and system data. After finishing the installation. You will see something like the image below, follow the further instructions and you're done!

If you're not able to install zender successfully on your server, please contact us using the contact form on our codecanyon profile here. We will assist you for free.

## Messages

This platform was made for sending messages, that's why we've included the important features for your customers. These includes the following.

- Quick SMS Sending
- Bulk SMS Sending
- Message Templates
- Sent History

- Number Autocomplete
- Sim Chooser
- Priority Messages
- Receive History

#### Message Splitting

Zender gateway app supports sending long messages, it will split to multiple parts if the receiving device doesn't support long messages.

#### Smart Sending

If the user didn't choose a device before sending a message, the system will automatically decide what to use based on the amount of pending messages of devices, the device with lowest pending messages will be used to send the message. This feature also applies to API sending.

## Users

Zender has a complete user management system, this allows administrators to easily edit or delete user accounts in the admin panel. User registrations can also be disabled in the system settings. Key features of users.

- Edit Profile
- Upload Avatars
- Subscribe to Packages

- Login
- Register
- Retrieve Accounts

## Contacts

The system allows the users to add unlimited contacts numbers and contact groups, limiting these features by packages is planned to be added in the next update.

## Devices

Devices management is one of the most important part of zender, these allows the users to add their android mobile devices for sending sms messages. Adding a device to a user account is easy, we've included a simple step-by-step guide in the add device form. These form is also included by default in the english language pack to allow localization to multiple languages. Zender gateway app currently supports the following android versions.

- Android KitKat
- Android Lollipop
- Android Marshmallow
- Android Nougat

- Android Oreo
- Android Pie
- Android 10

#### Android KitKat

Dual sim sending for this android version is not supported, the sdk version has no in-built function for this purpose and we can't do anything about it. If the user choose to send a message on sim 2 on a KitKat device, it will be sent using sim 1.

## Tools

One of the reasons why Zender is ready for SaaS usage is the complete API features and Webhook system, it allows your customers to integrate their plan to their own platforms.

The API system of zender has a "permissions" feature, users can select appropriate permissions they need for each API Keys which will allow them to limit access to their account data. Currently, Zender API has the following permissions.

- Get Pending Messages
- Get Sent Messages
- Get Received Messages
- Send Message
- Create Contact
- Create Contact Group

- Get Contacts
- Get Contact Groups
- Get Device
- Get Devices
- Delete Contact
- Delete Contact Group

Webhooks was also available for your users, this will allow them to reply immediately when their selected device receives a new message. Complete guide was also included in the user dashboard.

## Packages

By default, the system includes 3 packages. The starter/default cannot be made paid or removed, this package is needed for new user registrations.

When adding a new package, you can limit the following user features.

- Daily Send Limit
- Daily Receive Limit
- Device Registration Limit

- API Key Limit
- Webhook Limit

Currently, zender only supports USD as payment currency.

Be careful when choosing package prices, too high prices can lose customers.

## Widgets

Zender navigation system is so smart that it only needs to refresh the page when logging-in, logging-out and registering. Because of that, zender uses modals to act as pages, these modals dynamically loads contents and saves a lot of bandwidth and resources. For advertisements, you can choose the block type of widget, these blocks can be easily added to template files by just including a one line block code.

After adding a modal, you can easily copy the toggle attribute by clicking the copy button of the row. The modal toggle attribute looks like this:

    zender-toggle="c20ad4d76fe97759aa27a0c99bff6710"

To make the modal work, just add the toggle attribute to any links or images like this:

HTML link example

    <a href="#" zender-toggle="c20ad4d76fe97759aa27a0c99bff6710">Click to show modal</a>

HTML image example

    <img src="image_link" zender-toggle="c20ad4d76fe97759aa27a0c99bff6710"/>

For widget blocks, clicking the copy button will give you this:

    {block_c51ce410c124a10e0db5e4b97fc2af39}

You can then include this block code to any tpl files in the dashboard and default template folders. After adding the block code, navigate to the page and you will see the block widget show to the document dynamically.

## Languages

The system support multple languages, new languages can be easily added in the admin panel. By default, english is used when the system is installed. Adding a new language in the admin panel will automatically include the english strings in the textarea to allow you translate it easily.

Zender includes 10 default languages:

- English (US)
- Korean
- Japanese
- Chinese (Simplified)
- French

- Russian
- Vietnamese
- Italian
- Indonesian
- German

Languages other than english are translated using google translate, you might encounter invalid translations. If you want to help improving a language translation, please visit the community forums.

#### RTL Support

Right to left is not currently supported. We've already included it in the official roadmap. Please visit the community forums for more info.

## Payments

These are the default payment gateways of zender, more gateways are already planned to be added in the next updates.

- Paypal

- Stripe

The paypal payment gateway uses PayPal Pro, this is the latest version of paypal payment system. There is no need to integrate paypal IPN because the payments are validated directly after the user completes a transaction. This requires paypal business account.

We assume that you already have a paypal account, follow the instructions here to get your live paypal username, password and signature.

Paste the credentials in the system settings, to go live. You must disable paypal test mode.

If you just want to test the gate way using paypal sandbox, go here to get your test credentials then paste it in the systems setting, you will also need to enable paypal test mode.

For stripe, the setup is pretty simple and straightforward. We assume that you already have a stripe account.

Login to your stripe account, then copy and paste your stripe secret key to zender system settings.

## Emails

Zender supports sending emails using php's native mail() function or thru remote smtp server. To use remote smtp server, follow the steps below, we will use gmail smtp in this guide.

The input fields for remote smtp are automatically populated by default to gmail settings, you'll just need to add your gmail email and password then save the system settings.

To use gmail smtp, you will need to enable less secure apps here.

If you want to use php native mail function, you just need to add site email then you're ready to go.

## Recaptcha

To protect your site from spam and bots, it is required to set up your site's recaptcha.

Go to google developer console here

Click the + (plus) icon on the top right of the page.

Follow these steps:

- Enter a label name, eg. MySite
- Select reCaptcha v2 and "I'm not a robot" tickbox
- Add your site's domain
- Accept the reCaptcha Terms of Service
- Click the Submit button
- Now copy the site key and secret key then paste in in your zender system settings. You're done!

## App Builder

Starting your own SaaS platform requires branding and with zender it's completely possible!

An integrated builder for the gateway app is included in system, we will do the dirty work for you. You'll be able to completely change the app's look and feel by adding your own package name, app logo, app splash screen and app colors.

The server gateway api is also integrated to the app itself, your users won't need to manually input the server url. They just need to scan their account code to register the device then start sending messages.

Before sending build request, make sure you have the following:

- A unique package name, we recommend mapping your app's package name to your site domain. For example: com.mydomain.gateway

  Once you specified a package name, we recommend to not change it because the unique id's of the devices depends on this. Frequent changing of package name can affect user accounts and registered devices! You have been warned!

- Attractive app name, you can map the gateway app name to your site's brand name. For example: Zender

  We recommend that your app name not exceed 8 characters to prevent app UI not fitting because of long app name

- App color, we recommend that the app color you choose matches the app icon/logo and app splashcreen background colors.

  This color will be used for status bar and app main theme color.

- Send interval, this is the interval between each message sending. Currently, this is hardcoded to the app itself. We already have plans to allow your customers to choose their preferred interval per device. Please read the official zender roadmap in the community forums. We recommend setting this value >= 5 seconds. Greater is better and saves a lot of compute time.

- Receive interval, the amount of time before sending new received messages to server. The data contains all messages sent the whole day, so we recommend that this value be >= 60 seconds. Greater is better and saves a lot of compute time.

- App icon/logo image, the image must be in png format with fixed resolution size of 1024x1024 in px. Your main brand art must be centered. Please view the sample app icon/logo image in the Builder directory included in your codecanyon downloaded zip file.

- App splashscreen image, the image must be in png format with fixed resolution size of 2732x2732 in px. Your main brand art must be centered. Please view the sample app splash image in the Builder directory included in your codecanyon downloaded zip file.

- Builder email, this is important, we will send a message in this email when our system is done building your app. Your app should be automatically uploaded to your server after building if the folder permissions to uploads/builder/ is properly set to 775. When the app is uploaded to your server, it is immediately available for download in the "Add Device" form.

After completing the requirements metioned above, add your codecanyon purchase code in the system settings then click the "Build App" button in the admin panel.

Wait for our email message verfying the successful build!

#### Build Intervals

Compiling android apk is resource extensive, so we limit how many times you can request for building app. For regular license holders, they can only build once every 24hrs. For extended license holders, they can build once every 4hrs which means 6 times a day!

The build server for regular and extended licenses are not the same.

## Chat Support

Our team wants you to get the best customer support!

An exclusive live chat widget is included in the admin panel, add your purchase code in the system settings then reload the page. The support chat widget should show automatically anywhere in the dashboard when the admin is logged in. Our team is available 12hrs (GMT+8) a day in the live chat.

## Community Forums

We have a dedicated community forums, only verified customers can login using their purchase codes.

If you have suggestions and ideas for new systems, post it there and we might be able to make your dream system into a real one!

For bug reports, you should also post it in the community forums.

To login to forums, click the forums button in the admin panel, make sure that you've already added your purchase code in the system settings!