Releases: zendesk/sunshine-conversations-web
v5.2.0
What’s New
New customizable strings
A new customizable string has been added to let the user know when a message has been seen: messageSeen.
Fixes
- Fixed an issue where the view would not scroll to the bottom of the conversation when tall images are sent.
v5.1.4
Fix
- Fixed typing events not triggering for conversations when they were not visible to the user.
- Fixed an issue causing email linking confirmation notifications to not display properly
- Fixed an issue where image placeholders were not visible for oversized images.
Release 5.1.3
Fix
- Fixed an issue where the loader was not always rejecting unsupported versions
Release 5.1.2
Fix
- Fixed an issue where the first message sent was not properly being processed.
Release 5.1.1
Fix
- Fixed an issue where conversations would be created even without the user sending a message when the
New conversation
button is clicked.
Release 5.1.0
What’s New
messageTooLongError
- Added new string
messageTooLongError
which is displayed when the user attempts to send a message longer than the maximum length (ie:4096 characters
). Businesses can customize this string by overriding themessageTooLongError
key.
Fix
- Fixed an issue where sending a message longer than
4096
characters left the UI stuck in a sending state.
Release 5.0.3
Fix
- The
conversation:read
event is now also triggered for the currently active user.
Release 5.0.2
Fixes
- Improved error tracking
Release 5.0.1
Fixes
- Improved error tracking
Release 5.0.0
v5.0.0
Upgrading to 5.0.0
This new major version of the Web Messenger brings a new loader script found here. Until the old loader script is replaced with the new snippet, no changes will be seen. Once the new script is running, the latest version of the Web Messenger will be loaded by default. Additionally this script also supports version pinning.
Detailed Changelog
✨ New Features
Loader Script
-
There is a new loader script for version
5.0.0
of the Web Messenger that will need to be used to load the latest version. -
In addition to serving the new version of the Web Messenger, the new loader allows integrators to pin a specific version (>=
4.0.0
)- If no changes are made to the loader script, the latest version will be loaded
- Integrators can instead replace the included version (
5
) with a supported major version (minimum4
) or a specific version (e.g.:4.29.21
)
Example pinning version 4.29.21
:
<script>
!function(o,p,s,e,c){var i,a,h,u=[],d=[];function t(){var t="You must provide a supported major version.";try{if(!c)throw new Error(t);var e,n="https://cdn.smooch.io/",r="smooch";if((e="string"==typeof this.response?JSON.parse(this.response):this.response).url){var o=p.getElementsByTagName("script")[0],s=p.createElement("script");s.async=!0;var i=c.match(/([0-9]+)\.?([0-9]+)?\.?([0-9]+)?/),a=i&&i[1];if(i&&i[3])s.src=n+r+"."+c+".min.js";else{if(!(4<=a&&e["v"+a]))throw new Error(t);s.src=e["v"+a]}o.parentNode.insertBefore(s,o)}}catch(e){e.message===t&&console.error(e)}}o[s]={init:function(){i=arguments;var t={then:function(e){return d.push({type:"t",next:e}),t},catch:function(e){return d.push({type:"c",next:e}),t}};return t},on:function(){u.push(arguments)},render:function(){a=arguments},destroy:function(){h=arguments}},o.__onWebMessengerHostReady__=function(e){if(delete o.__onWebMessengerHostReady__,o[s]=e,i)for(var t=e.init.apply(e,i),n=0;n<d.length;n++){var r=d[n];t="t"===r.type?t.then(r.next):t.catch(r.next)}a&&e.render.apply(e,a),h&&e.destroy.apply(e,h);for(n=0;n<u.length;n++)e.on.apply(e,u[n])};var n=new XMLHttpRequest;n.addEventListener("load",t),n.open("GET","https://"+e+".webloader.smooch.io/",!0),n.responseType="json",n.send()}(window,document,"Smooch","<integration-id>","4.29.21");
</script>
Conversation List
A new conversation list view has been introduced allowing users to navigate between their conversations.
- If the
canUserSeeConversationList
config setting is set totrue
the user will be able to navigate to this view once they have at least one conversation. - If the
canUserCreateMoreConversations
config setting is set totrue
the user will be able to create new conversations from this view.
See our public guide for more detail.
Client APIs
-
createConversation
allows integrators to create a conversation oftype
:personal
. It will also create auser
if one does not already exist. -
updateConversation
allows integrators to update thedisplayName
,iconUrl
,description
, andmetadata
properties of a conversation. -
hasMoreConversations
determines if the user has more conversations to be fetched from the server -
getMoreConversations
fetches and returns the next conversations (at most 10) of the user to be loaded to the view. -
getDisplayedConversation
returns the conversation object currently viewed by the user. Returnsnull
if the user is viewing the conversation list.
Events
- A new
reconnecting
event can now be subscribed to. For example:Smooch.on('reconnecting', () => { console.log('Reconnecting...'); })
customText
The following new customizable strings have been introduced. See the readme for more details.
- Errors displayed in the notification banner:
couldNotConnectRetry
couldNotConnectRetrySuccess
couldNotLoadConversations
- Channel Linking:
emailLinkingErrorMessage
linkChannelPageHeader
syncConversation
- Conversation List:
conversationListHeaderText
conversationListRelativeTimeJustNow
conversationListRelativeTimeMinute
conversationListRelativeTimeMinutes
conversationListRelativeTimeHour
conversationListRelativeTimeHours
conversationListRelativeTimeYesterday
conversationListTimestampFormat
conversationListPreviewAnonymousText
conversationListPreviewCarouselText
conversationListPreviewFileText
conversationListPreviewFormText
conversationListPreviewFormResponseText
conversationListPreviewImageText
conversationListPreviewLocationRequestText
conversationListPreviewUserText
newConversationButtonText
🧨 Breaking Changes
SDK Initialization Validation
The initialization validation of the SDK that we perform in some of our Client API methods, which may return an error saying Must provide an externalId and a JWT to log in.
, is now returned as a rejected Promise
in the following asynchronous methods:
- getConversationById
- loadConversation (added validation)
- markAllAsRead (added validation)
- render
- sendMessage
- triggerPostback
Synchronous validation (errors thrown) has been added in the following methods:
- setPredefinedMessage (added validation)
- showNotificationChannelPrompt (added validation)
customText
The following custom strings have been removed. The usages of these strings in the config can be safely removed from your code.
connectNotificationSingleButtonText
connectNotificationOthersText
couldNotConnectInner
couldNotConnectWithRetry
couldNotConnectWithRetryInner
introductionText
Client APIs
-
init
has had changes to theoptions
argumentappId
is no longer supported. The suggestion to useintegrationId
instead was first mentioned in the v4.29.0 release, and as ofv5.0.0
support for it has been removed.userId
is no longer supported,externalId
should be used instead- Renamed
fixedIntroPane
tofixedHeader
-
login
no longer supportsuserId
,externalId
should be used instead -
getUser
will now return an empty object rather thanundefined
if there is no user -
updateUser
will now return an empty object rather thanundefined
if there is no user -
getConversation
has been removed in favor ofgetDisplayedConversation
-
getConversations
no longer accepts anoffset
and will now return all the conversations currently stored in memory.getMoreConversations
can be used to load more conversations into memory. -
startConversation
has been removed in favor ofcreateConversation
-
conversationId
is now a required argument forsendMessage
andtriggerPostback
-
The following user properties have been updated for the payload returned by
getUser
andupdateUser
_id
is nowid
userId
is nowexternalId
properties
is nowmetadata
-
The following
conversation
properties have been updated for the payload returned bycreateConversation
,getConversationById
,getConversations
,getDisplayedConversation
,getMoreConversations
,login
, andupdateConversation
_id
is nowid
- The following `partic...