Salesforce Messaging for Web Sound Notification to Visitors
39 views
Aug 11, 2025
Show More Show Less
View Video Transcript
0:05
Hello everyone. In this video, we are
0:07
going to see how to add sound
0:11
notification to Salesforce messaging for
0:14
web chat visitors. Let's say I am making
0:17
use of Salesforce messaging for web.
0:21
We have to host Salesforce embedded
0:24
service code snippet in our third party
0:26
websites so that the visitors can
0:29
initiate messaging session and then they
0:31
will be able to interact with agent
0:33
force agents or Einstein bot or with the
0:36
real human agents. In that case whenever
0:40
the message is sent from the
0:43
visitor or whenever it is uh sent from
0:47
the Einstein bot or agent force agents
0:50
or real human agents then we have to
0:53
play a sound notification to the
0:54
visitors so that they will be notified
0:58
via that notification and then they will
1:00
go to the particular uh browser and
1:03
browser tab and then they will be able
1:05
to continue the chat.
1:08
Let's first see a demo and then we will
1:11
dig deep into the technical part of it.
1:17
This is the site where uh Salesforce uh
1:20
messaging for web code is hosted. As a
1:23
chat visitor, I'm initiating Salesforce
1:26
messaging for web messaging session
1:29
and as an Salesforce service rep, I have
1:33
accepted the messaging session. Now as a
1:37
chat visitor I'm going to send a
1:39
message. It will play a notification.
1:45
So it played a notification as well as
1:48
it sent the message to the human agent.
1:51
So now as a human agent I'm going to
1:53
send it back. Send a message back to the
1:55
chat visitor.
2:02
The chat visitor heed a notification and
2:06
also they were able to see the message
2:08
that was sent by the service rep.
2:12
Let's see how the notification was
2:14
played.
2:19
I am making use of a sample music.mpp3
2:22
MP3 file in my website and this is the
2:26
index. MD which is a HTML file which is
2:30
hosted in my server. So here I am making
2:35
use of audio HTML tag
2:39
to
2:41
to play the uh sorry to host the MP3
2:44
file. So this is where I am making use
2:48
of it. Next we get the code snippet from
2:51
Salesforce. In that code snippet I have
2:54
added this particular JavaScript uh line
2:58
uh lines so that I can play the
3:00
notification whenever the message is
3:02
sent or received on the uh website
3:06
visitor side.
3:09
Whenever a message is uh received or
3:11
sent by the chat visitor on embedded
3:15
message sent event is fired. So make so
3:18
I'm making use of window.adde
3:20
eventlister to listen to on embedded
3:22
message sent event. Whenever this event
3:25
is fired I am making use of
3:27
document.getelement by id and then I'm
3:30
getting the audio file and with the help
3:33
of play method I am playing the the
3:37
audio file. So using this uh HTML tag
3:41
and with this uh window.adde eventlister
3:44
JavaScript code I was able to listen to
3:47
the
3:48
on embedded message event sent uh sorry
3:52
on embedded message uh sent event and
3:54
this event will be fired whenever the
3:56
message is sent or received on the
3:57
visitor side.
4:05
Please check the video description. In
4:07
the video description, I have shared my
4:09
blog post. From the blog post, you
4:11
should be able to get the sample HTML
4:13
code and as well as the JavaScript code
4:16
for the window. Eventlister to on
4:19
embedded message sent event for your
4:21
reference.
4:28
I hope it was helpful.
4:34
Thank you for watching.
#Internet Software