Skip to content

liveChat Additional info

Vahid Hedayati edited this page Nov 1, 2015 · 1 revision

#Additional information

LiveChat - When live bot connects to end user:

At this point you should really ensure the Mail plugin has been configured correctly on your local application. The mail plugin has been installed as part of the wschat plugin

https://github.com/vahidhedayati/grails-wschat-plugin/blob/master/build.gradle#L70

But needs configuring locally in your application, since the process will attempt to email site admins (users that have logged in to the site and have been given admin privilages when they logged in)

So ensure you have configured Mail correctly :

http://gpc.github.io/grails-mail/guide/2.%20Configuration.html

Do a test from your own controller - ensure you can send a dummy mail to your self, then look at using this chat feature and also then ensure you have added the extra config:

wschat.liveChatPerm='admin'  // this is the group of users that livechat belongs to and if those uses have an email address in profile they will also be emailed
wschat.liveContactEmail='me@myemail.com' // this is the hard coded live chat email
wschat.liveChatUsername='Me '  // this is the nickname upon them joining a live request
wschat.liveContactName='Me Me'  // this is the person that email title is set to

What is going on well lets look up the message in the code base:

https://github.com/vahidhedayati/grails-wschat-plugin/search?utf8=%E2%9C%93&q=attempting+to+retrieve+a+member+of+staff+for+you

https://github.com/vahidhedayati/grails-wschat-plugin/search?botLiveMessage

https://github.com/vahidhedayati/grails-wschat-plugin/blob/master/grails-app/services/grails/plugin/wschat/auth/WsChatAuthService.groovy

It ends up in :

https://github.com/vahidhedayati/grails-wschat-plugin/blob/master/grails-app/services/grails/plugin/wschat/auth/WsChatAuthService.groovy#L130

chatClientListenerService.sendDelayedMessage(currentSession, message,1000)

so on line 129 you could do

println "Messaging to admin :  ${message}"

You would see what is going on

You should alternatively be able to see your debug messages if you enable debug /error messages in your logj config:

https://github.com/vahidhedayati/testwschat/blob/035e87d49cb308f421a2b3d04edf1f6357713ea7/grails-app/conf/Config.groovy#L107-L120

log4j.main = {
    // Example of changing the log pattern for the default console appender:
    //
    //appenders {
    //    console name:'stdout', layout:pattern(conversionPattern: '%c{2} %m%n')
    //}

	
	error 'grails.plugin.wschat'  //capture wschat errors
	debug 'grails.plugin.wschat' //capture wschat debug 
    error  'org.codehaus.groovy.grails.web.servlet',        // controllers
           'org.codehaus.groovy.grails.web.pages',          // GSP
           'org.codehaus.groovy.grails.web.sitemesh',       // layouts
           'org.codehaus.groovy.grails.web.mapping.filter', // URL mapping
           'org.codehaus.groovy.grails.web.mapping',        // URL mapping
           'org.codehaus.groovy.grails.commons',            // core / classloading
           'org.codehaus.groovy.grails.plugins',            // plugins
           'org.codehaus.groovy.grails.orm.hibernate',      // hibernate integration
           'org.springframework',
           'org.hibernate',
           'net.sf.ehcache.hibernate',
		   'grails.plugin.wschat'  //capture wschat errors
}

Clone this wiki locally