Plugin lead.

It's marketing plugin. It uses for manual and automated lead generation.

1.                                           Lead CRM config panel
========================================================================================================================
========================================================================================================================

a) Import leads and organizations
In this tab admin able to upload organizations or leads from csv file.
Here you can find file structure examples for lead and organization.

                                            Lead config section
========================================================================================================================
b) Opportunity stages

Plugin use opportunity stages for "opportunities" which you can find under detailed lead screen on the dashboard
in "log opportunity tab".

By default you have "Won" and "Lost" stage opportunity. You can change labels for them.
Also you can set opportunities for 10%, 20%, 30%, 40%, 50%, 60%, 70%, 80%, 90%.
After label assigned you will be able to find them in "log opportunity" tab.

c) Lead type (source)

Plugin uses lead type to distinguish the source of the lead. It's fully automated process. You can find them on the lead grid.

yourWebsiteUrl/dashboard/leads/

By default we have next lead types:

                                Inbound section (actions made by user)
======================        ==========================================                      ==========================
inbound_email - marked all leads which has been created during incoming email (hasn't implemented yet)

inbound_call - if website has been connected to https://mojo.seosamba.com/  and you bought mobile number.
After you received a phone call on this number new lead will be created on the website and will be marked with this status.
(new lead will be created)

After direct call if lead doesn't exist new lead will be created.
Next fields used.
caller -> mobile
caller_name -> first name
FromZip - zip

inbound_quote - all new users who created a quote first time will be marked with this status. (new lead will be created)
Quote form field names used for lead.
email -> lead email (unique per lead)
name -> lead first name
lastname -> lead last name
mobile-> lead mobile (without country code)
phone -> lead phone (without country code)
zip -> lead zip
address -> lead address
prefix -> lead prefix (Mr. etc..)
city -> lead city


inbound_purchase - all new users who placed an order first time will be marked with this status.  (new lead will be created)



inbound_quote_view - uses for action log. (quote views by user)

inbound_registration - all new registered users through system widget "sign up" will have this status. (new lead will be created)

-email
-first name
-last name

inbound_form - system form submit. Based on email address.  (new lead will be created)

Form field names used for lead.
email -> lead email (unique per lead)
name -> lead first name
lastname -> lead last name
mobile-> lead mobile (without country code)
phone -> lead phone (without country code)
zip -> lead zip
address -> lead address
position -> lead position

How it works?
1. plugin checks if  exists lead with email which user provided in the form. If not then new lead will be created. And ip address will be added for this lead.
2. In case if lead with such email exists then plugin checks form fields and if existing lead record doesn't have data for those columns then this data will be added.
 Also if user submitted form using different ip address. Additional ip address will be added to lead profile.
3. If user logged into the system and lead record wasn't tied with real system user. Then it will be tied automatically. (based on user logged email)
4. Each lead has unique mobile country code + number and phone country code + number. If any other lead has the same mobile or phone number. It won't be added
to the lead record.

inbound_downloader - during file download (downloader plugin needed). (new lead will be created)

Form field names used for lead.
email -> lead email (unique per lead)
name -> lead first name
lastname -> lead last name
mobile-> lead mobile (without country code)
phone -> lead phone (without country code)
zip -> lead zip
address -> lead address
position -> lead position


inbound_website_visit - websites visits (hasn't implemented yet)


                             Outbound section (actions made by admin)
=============              =============================================          ======================================
outbound_email - uses for action log. If admin sent email on the lead detailed screen from "Email" tab.

outbound_call - uses for action log. If admin placed a call on the lead detailed screen from "Call" tab.

outbound_quote - uses for action log. If admin created a quote on the lead detailed screen "Log opportunity tab" or "Opportunities tab"

outbound_meeting - uses for action log. If admin scheduled a meeting on the detailed screen "Meeting" tab.

d) Lead Source. You can find them on the lead grid. yourWebsiteUrl/dashboard/leads/
    System handles this part in automated way. But you can create new lead source.
    Plugin predefined sources.
    1) Referrer Your CRM automatically displays referring url’s for your inbound quotes and leads.
    2) Marketing asset Your CRM automatically displays marketing campaign/asset names associated with phone numbers that callers have dialed. You need a SeoSamba number for this to work.
    3) Ad campaign  Your CRM automatically displays your Ad campaign names. You need to tag your advert destination urls with Source utm tags for this to work.
    List of utm tags utm_source, utm_medium, utm_campaign, utm_term, utm_content

e) Lead lifecycle Stage. You can find them on the lead grid. yourWebsiteUrl/dashboard/leads/
    Lead lifecycle. You can manually assign it to the lead on the lead grid.

f) Lead tags
    Lead tags used to mark lead by tag.
    You can assign several tags for a single lead. You can add them on lead detailed screen on dashboard.
    Go to yourWebsiteUrl/dashboard/leads/ and click on any lead name.

g) Custom lead fields. You can find them on yourWebsiteUrl/dashboard/leads/ and click on any lead name. Under "Additional info" tab.
    Allow you to create some custom attributes.

h) Lead social services.
    By default we have next social services "X", "linkedin", "facebook". You can find them on yourWebsiteUrl/dashboard/leads/ and click on any lead name.
    Also you can easily new one. Just provide social service name and uploade image for it.

i) Lead config (general lead config) tab
   Plugin has setup for first and second task reminders.

                                          Organization config section
========================================================================================================================

i) Industry organizations. Industry organization. You can find them on yourWebsiteUrl/dashboard/organizations/.

j) Custom organization fields. You can find them on yourWebsiteUrl/dashboard/organizations/ and click on any organization name. Under "Additional info" tab.


2.                                           Lead grid  "yourWebsiteUrl/dashboard/leads/"
========================================================================================================================
========================================================================================================================

On lead grid you can find all leads.

                                                ========Lead grid fields==========

Name - lead first name plus last name. On click you will see the screen with detailed information about lead (also you can change first name and last name here).
Organization - organization name (auto-complete for existing organizations). After you provided new organization name new organization will be automatically created.
Email - lead email address. You can have only one lead per email address. If lead already tied with real user you can't change it.
Mobile - lead mobile without country code. (You can change mobile number and country code on detailed screen).
Last activity on - displays date of last lead activity such as (downloaded document, submitted form, new purchase, new quote or even registration).
Next action on - displays date of next (closest) action for the lead. Based on created by admin "task" or "scheduled meeting".
Total opportunities amount - sum of all opportunities created for current lead.
Stage - "Lead lifecycle Stage". See section 1e.
Customer group - shopping customer group. You can create/edit new customer group on the Merchandising-> Customer groups.
Total Spend - displays total amount spent by lead which already become user and made some purchases.
Lead type - "Lead type source" Automated assigned type. See section 1c.
Lead Source - See section 1d.
Action - there are two action. 1 - call to the lead (Detailed information you can find below). 2 - delete lead.

                                                ========Recently viewed===========

 Displays last 10 opened lead or organizations by currently logged user.


                                                =========Quick contact============
 Uses for new lead creation.
 Email - must be unique for each lead. If you have lead with the same email system will change button from "Add lead" to "Go to profile". (required field)
 First name - lead first name (required field).
 Last name - lead last name (required field)
 Organization - organization name (auto-complete for existing organizations). After you provided new organization name new organization will be automatically created.(optional field).
 Lead mobile country code - (optional field)
 Lead mobile - (option field).

 Note!!! You can't have several leads with the same mobile or phone number.

                                =======================Filters section============================


                                ====================Filter settings presets=======================

You can have several filter presets. It will be visible only for you by default. But you can mark "Show to all CRM users" to allow preset to other users.
Also you can mark it as default after that next time preset will be applied automatically.

 3.                                  Lead detailed screen "yourWebsiteUrl/dashboard/leads/#lead/lead-id-here/"
========================================================================================================================
========================================================================================================================
You can access this screen from lead grid by clicking on lead full name or by direct link which looks like "yourWebsiteUrl/dashboard/leads/#lead/12"

Here you can change next items.

Prefix - lead prefix Ex: Mr.
lead first name - lead first name
middle name - middle name
lead last name - lead last name
position - lead position
organization name - organization name (auto-complete for existing organizations). After you provided new organization name new organization will be automatically created.
email - must be unique for each lead. Also you can't change it if lead already tied with real user.
mobile number - mobile number
mobile country code - mobile country code
phone number - phone number
phone country code - phone country code
phone extension - phone extension
Address1 - address 1
Address2 - address 2
City - city
Zip - zip
Country - country
State - state

You can assign customer group - shopping customer group. You can create/edit new customer group on the Merchandising-> Customer groups.

You can create/delete new tag for the lead.
                                                Detailed view stats
                                ======================================================
Next action on: - displays date of next (closest) action for the lead. Based on created by admin "task" or "scheduled meeting".
Last action on: - displays date of last lead activity such as (downloaded document, submitted form, new purchase, new quote or even registration).
Lead owner: - displays lead owner

Total Opportunities: - displays count and amount for all opportunities of current lead.
Total Sales: - displays total amount spent by lead which already become user and made some purchases.


                                            Tabs on detailed lead view
========================================================================================================================

   a) Notes

        Simple adding notes to the lead.

   b) Task

        Here you can create task to anyone from store administration team.
        You must create action email "Task reminder"
        Lexems for the email {task:assignedFullName} - displays name of assigned person
        {task:creatorFullName} - displays name of task creator


   c) Meeting

        Here you can schedule meeting.
        You can provide additional email separated by comma in "Invite additional attendees".
        As result everyone will receive scheduled invitation inside email.

   d) Email.
         You can send email with predefined template.
         You can insert images or attach files by choosing "insert to link" and then clicking on image and files.
         You can provide additional email separated by comma in "To".
         You can choose "Useful shortcuts" to insert lexem inside email.
         For now plugin support two lexems "Lead first name" and "Lead last name"

   e) Call.
        To use this functional you will need to connect website to the https://mojo.seosamba.com/.
        Then buy mobile number.
        After that go to the "Other" -> "Manage users" and assign your own "Mobile phone" for mobile phone.
        For desktop number create add custom attribute "phone".
        And then you can click "call"

   f) Log opportunity
        In this tab you can create opportunity. And then create quotes under this opportunity.


                                                Timeline
========================================================================================================================

Timeline displays different data of actions taken by lead(user) and admin.

                                                Opportunities
========================================================================================================================

                                                Additional info
========================================================================================================================

Here you can find additional lead fields which you created on crm configuration screen "Custom lead fields".



4.                       Organization grid  "yourWebsiteUrl/dashboard/organizations/"
========================================================================================================================
========================================================================================================================

                                  ========Organization grid fields==========
Organization name - organization name. On click you will see the screen with detailed information about organization.
Main contact name - lead which assigned as primary contact.
Website - organization website.
Customer group  - shopping customer group. You can create/edit new customer group on the Merchandising-> Customer groups.
Phone - lead phone without country code. (You can change mobile number and country code on detailed screen).
Industry - organization industry.
Total opportunities - total opportunities of all leads under this organization.
Total sales - total user sales under this organization.
Last interaction type - displays lead activity under organization such as (downloaded document, submitted form, new purchase, new quote or even registration).
Last interaction date - displays date lead activity under organization such as (downloaded document, submitted form, new purchase, new quote or even registration).
Actions - you can only delete organization for now.


5.          Organization detailed screen "yourWebsiteUrl/dashboard/organizations/#organization/organization-id-here/"
========================================================================================================================
========================================================================================================================
You can access this screen from lead grid by clicking on organization name or by direct link which looks like "yourWebsiteUrl/dashboard/lorganizations/#organization/170"

Here you can change next items.

Organization name - organization name.
email - email
mobile number - mobile number
mobile country code - mobile country code
phone number - phone number
phone country code - phone country code
phone extension - phone extension
Address1 - address 1
Address2 - address 2
City - city
Zip - zip
Country - country
State - state

You can assign customer group - shopping customer group. You can create/edit new customer group on the Merchandising-> Customer groups.

                                                Detailed view stats
                                ======================================================
Next action on: - displays date of next (closest) action for the lead. Based on created by admin "task" or "scheduled meeting".
Last action on: - displays date of last lead activity such as (downloaded document, submitted form, new purchase, new quote or even registration).
Lead owner: - displays lead owner

Total Opportunities: - displays count and amount for all opportunities of current lead.
Total Sales: - displays total amount spent by lead which already become user and made some purchases.


                                                    Lead tasks import
========================================================================================================================
Mandatory field:

lead_id - lead id or external_id - external lead id
task_title - title of the task
assigned_to - person for whom task has been created  It must a valid email address.
    It must be a user in the system with role admin, sales person or superadmin
    Ex:salesperson@example.com

assigned_by - person who assigned the task.
It must a valid email address.
It must be a user in the system with role admin, sales person or superadmin
Ex:salesperson@example.com !!! If not provide the superadmin instead will be used.

task_date_time - date of the task expiration Ex: 2017-04-21 06:00:00
notes - Ex: Some notes here
created_at - date of the task creation.
If not provided then current date will be used.
Ex: 2017-04-01 15:00:00

!!! important. All dates will use store timezone.

Also you can use task_external_id in case if you want to re-import tasks again.

                                                      Import Leads
========================================================================================================================
"lead_import_sample_structure.csv" fields description:

custom_field_name -  You can add custom field after "custom_". Allowed any field_name after "custom_".
                      Example:  custom_myfieldname
social_name -
social_link - use these columns as fastest way to add one social service. If you want to add several social services, use
              "social_service_name" columns.

social_service_name - You can add social_service_name after "social_". Service name must be one of the "Lead social services" from CRM config.
                      Example:  social_facebook

                                               Import Leads and Organizations options
========================================================================================================================
Mandatory fields:

custom_fields_names - option name
option_types - allowed option types ( text,date,checkbox,dropdown )
For Checkbox and select the option_value_names value is required

If custom_fields_labels row value empty, the value is taken from the custom_fields_names value.

                                Lead owner widget for Email remarketing used for emails
========================================================================================================================
 {$leadowner:fullname} - return lead owner full name
 {$leadowner:email} - return lead owner email
 {$leadowner:mobilephone} - return lead owner mobile phone
 {$leadowner:mobilecountrycode} - return lead owner mobile country code
 {$leadowner:desktopcountrycode} - return lead owner desktop country code
 {$leadowner:desktopphone} - return lead owner desktop phone
 {$leadowner:fullmobilephone} - return lead owner full mobile phone
 {$leadowner:fulldesktopphone} - return lead owner full desktop phone
 {$leadowner:signature} - return lead owner signature
 {$leadowner:personalcalendarurl} - return lead owner personal calendar url
 {$leadowner:avatarlink[:src]} - return lead owner avatar link
 src - return avatarlink source.

                                Lead widgets
 =======================================================================================================================
 Last name: {$lead:lastname}
 First name: {$lead:firstname}
 Middle name: {$lead:middlename}
 Position: {$lead:position}
 Prefix: {$lead:prefix}
 Full mobile number: {$lead:fullmobilephone}
 Full desktop number: {$lead:fulldesktopphone}
 Organization name: {$lead:organizationname}
 Organization logo: {$lead:organizationlogo[:src:[userid:{$quote:userid}]]}
 src - return logo source.
 userid:{$quote:userid} - {$quote:userid} is ex. widget which return user ID.
 Lead source: {$lead:source}
 Lead full name link: {$lead:leadfullnamelink} - returns link to lead profile
 Organization name link: {$lead:organizationnamelink} - returns link to organization profile


                    Crm login route
 ======================================================================================================================
 You can use next structure for the url.

Ex: redirect to the url
crmLogin/redirectTo/contact.html  - it's equal to contact.html

Ex: redirect to the tab with some params
crmLogin/tabName/dashboard/subTab/leads/paramHashName/lead/paramHash/134/  - it's equal to dashboard/leads/#lead/134

                                Remote user authorization/user creation
=======================================================================================================================
{$lead:remoteauthlink[:multiply]}
{$lead:remoteauthlink} - generate remote authorization link. If user doesn't exist new user will be created (role customer).
Lead must have an email address.!!!!!!!!!!!!!!!!
multiply - permanent token (user will be able to re-use authorization link)
After login user will be redirected to the "Store client landing page"

                                        NPS review request
=======================================================================================================================
{$lead:npsreviewrequest[:score]} - generate link for score request
:score - list of possible values - 0,1,2,3,4,5,6,7,8,9,10

                                            Action emails
========================================================================================================================
{widcard:BizEmail} - This lexem return widcard email address

                                        Open api endpoint
========================================================================================================================
How to enable -> plugin_leads_config -> enableOpenApi should be set 1
Organization endpoint /api/leadsopenapi/leadorganization/'            

                                Lead emails queue validation
========================================================================================================================
 {$leademailvalidation:createdat} - created at
 {$leademailvalidation:creator} - creator full name
 {$leademailvalidation:processedat} - processed at
 {$leademailvalidation:total} - total items
 {$leademailvalidation:processed} - successfully processed emails
 {$leademailvalidation:notprocessed} - not processed emails
 {$leademailvalidation:balance} - balance


{$leadquote:customparam:{$quote:id}:paramname} - display lead custom param

                                Lead email for queued sequence mass action notification
========================================================================================================================
 {$leadmassactionsqueue:createdat} - created at
 {$leadmassactionsqueue:creator} - creator full name
 {$leadmassactionsqueue:processedat} - processed at
 {$leadmassactionsqueue:total} - total items
 {$leadmassactionsqueue:processed} - successfully processed emails
 {$leadmassactionsqueue:notprocessed} - not processed emails
 {$leadmassactionsqueue:additionaldata:paramname} - additional param


                                            User email reports
 =============================================================================================================
{emailreportcontent:{$leademailreports:userid}:tasks}{/emailreportcontent} - email reports magic space
{$leademailreports:tasks} - render task stats daily report
{$leademailreports:meetings} - render meetings stats daily report
{$leademailreports:notes} - render notes stats daily report

{$leademailreports:fullname} - fullname
{$leademailreports:reportdate} - today report date
{$leademailreports:reportdateyesterday} - yesterday report day

tasks - completed,created,expires_today
meetings - completed,created,today
notes

