Sage CRM Developers Course Programming for the Advanced

  • Slides: 27
Download presentation
Sage CRM Developers Course Programming for the Advanced Email Manager

Sage CRM Developers Course Programming for the Advanced Email Manager

Looking ahead to the classes DP 01: Introduction to the Development Partner Program DP

Looking ahead to the classes DP 01: Introduction to the Development Partner Program DP 02: Entities and the Data Model (Part 1 of 2) DP 03: Entities and the Data Model (Part 2 of 2) DP 04: Implementing Screen Based Rules (Part 1 of 2) DP 05: Implementing Screen Based Rules (Part 2 of 2) DP 06: Screen and User Independent Business Rules DP 07: Workflow (Part 1 of 2) DP 08: Workflow (Part 2 of 2) DP 09: Using the API Objects in ASP Pages (Part 1 of 2) DP 10 : Using the API Objects in ASP Pages (Part 2 of 2) DP 11: Using the Component Manager DP 12: Programming for the Advanced Email Manager DP 13: Using the Web Services API DP 14: Using the Web Services API (Part 2 of 2) DP 15: Coding the Web Self Service COM API (Part 1 of 2) DP 16: Coding the Web Self Service COM API (Part 2 of 2) DP 17: Using the. NET API (Part 1 of 2) DP 18: Using the. NET API (Part 2 of 2)

Agenda How the Email Manager works and processes emails. Creating a template Calling new

Agenda How the Email Manager works and processes emails. Creating a template Calling new functions Processing data Opportunities Leads Communications

Getting Started Do you have an email server to test with? VPOP – Paul

Getting Started Do you have an email server to test with? VPOP – Paul Smith Computing Services – http: //www. pscs. co. uk/downloads/vpop 3. php CMAIL – http: //www. youngzsoft. net/

Documentation and Resources System Administration Guide E-mail Management E-mail Configuration and E-mail Status Textpad

Documentation and Resources System Administration Guide E-mail Management E-mail Configuration and E-mail Status Textpad Snippets – dpp. sagecrm. com

Services C: program filessageCRMservicese. Ware. Email. Manager. exe Hkey_Local_Machine, System, Current Control Set, Services

Services C: program filessageCRMservicese. Ware. Email. Manager. exe Hkey_Local_Machine, System, Current Control Set, Services CRMEscalation. Service Email. Manager

Clean out Old Install Configurations Open registry HKEY_LOCAL_MACHINESOFTWAREe. WareConfig Go through each install and

Clean out Old Install Configurations Open registry HKEY_LOCAL_MACHINESOFTWAREe. WareConfig Go through each install and blank – EMlogonid – EMPassword Except for install to be used

Advanced Email Manager Support for e-mail MAPI and POP Allows separate inbound/outbound mail servers

Advanced Email Manager Support for e-mail MAPI and POP Allows separate inbound/outbound mail servers Secure SMTP supported External databases may be read and written to via the custom scripting aspect. Each mailbox is accessed and controlled by its own thread within the application.

Creating a New Script File To create a new "Sales" email manager template. Save

Creating a New Script File To create a new "Sales" email manager template. Save the template into the same folder as the other template files. C: Program FilesSageCRMServicesCustom. PagesScriptssales. js The template will automatically be seen and made available to CRM for use in the Administration -> E-mail and Documents -> E-mail Management Server Options when creating a new email address option.

Create a New Function To allow a new function to be called from within

Create a New Function To allow a new function to be called from within template then you will need to add the following Translation Caption Family: Caption Code: US Translation: jsfunctions Sales. Enquiry(); Sales Enquiry Add other translations as required.

Basic Structure of Template Files See System Administration Guide Mytemplate. js Comments Initialise Variables

Basic Structure of Template Files See System Administration Guide Mytemplate. js Comments Initialise Variables General Event Functions – Before. Main. Action – After. Main. Action Main Functions (referenced in Config screen) – N. B. Main. Action is a reserved word. Do not call any function ‘Main. Action’ as this is internally replaced with function called from configuration screen. Utility Functions

Debugging Turn on Debugging in System In Template will use: Msg. Handler. Debug =

Debugging Turn on Debugging in System In Template will use: Msg. Handler. Debug = true;

Objects Available in Template User. Query e. Ware. Query object using – – SELECT

Objects Available in Template User. Query e. Ware. Query object using – – SELECT * FROM v. Users WHERE user_emailaddress = From. Address OR user_mobileemail = From. Address Person. Query e. Ware. Query object using – SELECT * FROM v. Email, v. Person WHERE email_personid – = pers_personid AND emai_emailaddress = From. Address Company. Query e. Ware. Query object using – SELECT * FROM v. Email, v. Company WHERE – emai_companyid = comp_companyid AND – emai_emailaddress = From. Address e. Ware object. . . logged on with admin user (as specified in configuration) Msg. Handler Debugging control e. Mail interface to the email

Monitoring of Account Log information C: Program FilesSageCRMServicesLogs20100712 CRM Mail. Manager. log *****Rules. Script

Monitoring of Account Log information C: Program FilesSageCRMServicesLogs20100712 CRM Mail. Manager. log *****Rules. Script is. . . **** if (b. Cond) { Assigned. User = 4; Assigned. Channel = 1; Sales. Enquiry(); } *****End of Rules. Script. **** Where additional rule sets are used the information passed to the script is changed *****Rules. Script is. . . **** if ((!Company. Query. EOF) && (Company. Query("comp_type")=="Customer") ) { Assigned. User = 4; Assigned. Channel = 1; Create. Repeat. Sale(); b. Cond=false; } if (b. Cond) { Assigned. User = 4; Assigned. Channel = 1; Sales. Enquiry(); } *****End of Rules. Script. ****

Errors in Log Error detection is based on the status of the script after

Errors in Log Error detection is based on the status of the script after it runs. The E-mail Management application runs the script and captures the result of the script running. Log file will contain the script and the error information. The section where the script failed is highlighted. E-mails that cause the system to fail internally are saved in a rogue e-mail folder, which is located in. . . Program FilesSageCRMServicesCustom. PagesScripts

Email Object Properties Body - String (read/write) Is. HTML - Boolean (read/write) Subject -

Email Object Properties Body - String (read/write) Is. HTML - Boolean (read/write) Subject - String; (read/write) Priority - Integer (read/write) Recipients - Address. List Object Sender. Name - String (read/write) Sender. Address - String Delivery. Time - Date Attachments - Attachment. List Object BCC - Address. List Object Methods Send() Add. File('physical path') Clear() Header("named header")

Other Objects Address. List Attachment. List Properties – Items(index) – Count - Integer(readonly) Methods

Other Objects Address. List Attachment. List Properties – Items(index) – Count - Integer(readonly) Methods – Address(Address, Name) Mail. Address Properties – Name - String (read/write) – Address - String (read/write) – Items(index) – Count - Integer(readonly) – Library. Path - String Attachment Properties – Name - String (read/write) – Extension - String (read only) Methods – Save(Name, Path) – Save. As(Name, Path)

Adding Debugging Messages function Before. Main. Action() { Msg. Handler. Log("Before. Main. Action function

Adding Debugging Messages function Before. Main. Action() { Msg. Handler. Log("Before. Main. Action function called"); } function After. Main. Action() { Msg. Handler. Log("After. Main. Action function called"); }

Example Main Function function Sales. Enquiry() { //add debug message to indicate that function

Example Main Function function Sales. Enquiry() { //add debug message to indicate that function called //if sender is known contact then log new opportunity //create communication //automatically acknowledge email If sender is unknown then //create lead //create communication //automatically acknowledge email } function Sales. Enquiry() { Msg. Handler. Log("Sales. Enquiry function called"); //check if person exists if (!Person. Query. EOF) { create. Oppo(); create. Comm("Opportunity"); // send. Email(); } else { create. Lead(); create. Comm("Lead"); // send. Email(); } }

Example Create Opportunity function create. Oppo() { var my. Record = CRM. Create. Record("opportunity");

Example Create Opportunity function create. Oppo() { var my. Record = CRM. Create. Record("opportunity"); my. Record. Oppo_Primary. Company. Id= Person. Query("pers_companyid"); my. Record. Oppo_Primary. Person. Id= Person. Query("pers_personid"); my. Record. Oppo_Assigned. User. Id= Assigned. User; my. Record. Oppo_Channel. Id= Assigned. Channel; my. Record. Oppo_Description= e. Mail. Subject. substring(0, 39); my. Record. Oppo_Source= "Email"; my. Record. Oppo_Note= "Please see the attached email"; my. Record. Oppo_Status= "In Progress"; my. Record. Oppo_Stage= "Lead"; my. Record. Oppo_Opened = mydate. get. Var. Date(); my. Record. Set. Workflow. Info("Opportunity Workflow", "Lead") my. Record. Save. Changes(); int. Oppo. Record. ID = my. Record. oppo_opportunityid; }

Example Create Lead function create. Lead() { var my. Record = CRM. Create. Record("lead");

Example Create Lead function create. Lead() { var my. Record = CRM. Create. Record("lead"); my. Record. lead_Assigned. User. Id= Assigned. User; my. Record. lead_Channel. Id= Assigned. Channel; my. Record. lead_Description= e. Mail. Subject. substring(0, 39); my. Record. lead_Source= "Email"; my. Record. lead_Details= "Please see the attached email"; my. Record. lead_Status= "In Progress"; my. Record. lead_Stage= "New. Lead"; my. Record. lead_Opened = mydate. get. Var. Date(); my. Record. Set. Workflow. Info("Lead Workflow", "Assigned") my. Record. Save. Changes(); int. Lead. Record. ID = my. Record. lead_leadid; }

Example Send Email function send. Email(strsubject) { e. Mail. Is. HTML = true; Sender.

Example Send Email function send. Email(strsubject) { e. Mail. Is. HTML = true; Sender. Name = e. Mail. Sender. Name; Sender. Address = e. Mail. Sender. Address; Mail. Subject = e. Mail. Subject; Mail. Body = e. Mail. Body; e. Mail. Clear(); e. Mail. Recipients. Address(Sender. Address, Sender. Name); e. Mail. Sender. Name = Msg. Handler. Email. Address; e. Mail. Sender. Address = Msg. Handler. Email. Address; if (strsubject == "") { e. Mail. Subject = CRM. Get. Trans("Gen. Captions", "Auto. Reply") + ": " + Mail. Subject } else { e. Mail. Subject = strsubject; } e. Mail. Body = CRM. Get. Trans("Gen. Captions", "Your mail has been logged") + "<BR>" + CRM. Get. Trans("Gen. Captions", "Thank you") + "<BR>" + CRM. Get. Trans("Gen. Captions", "Panoply Support") + "<BR>" + Mail. Body; e. Mail. Send(); }

Q&A

Q&A

Looking ahead to the classes DP 01: Introduction to the Development Partner Program DP

Looking ahead to the classes DP 01: Introduction to the Development Partner Program DP 02: Entities and the Data Model (Part 1 of 2) DP 03: Entities and the Data Model (Part 2 of 2) DP 04: Implementing Screen Based Rules (Part 1 of 2) DP 05: Implementing Screen Based Rules (Part 2 of 2) DP 06: Screen and User Independent Business Rules DP 07: Workflow (Part 1 of 2) DP 08: Workflow (Part 2 of 2) DP 09: Using the API Objects in ASP Pages (Part 1 of 2) DP 10 : Using the API Objects in ASP Pages (Part 2 of 2) DP 11: Using the Component Manager DP 12: Programming for the Advanced Email Manager DP 13: Using the Web Services API DP 14: Using the Web Services API (Part 2 of 2) DP 15: Coding the Web Self Service COM API (Part 1 of 2) DP 16: Coding the Web Self Service COM API (Part 2 of 2) DP 17: Using the. NET API (Part 1 of 2) DP 18: Using the. NET API (Part 2 of 2)