Help with a Form

The web script I’m trying to modify, currently/successfully allows Users to message each other on the site.
I have gotten some partial help with trying to add a feature where when a message is received to a User that User is sent a simple email notification (that a message is waiting).

The current form (for internal messaging, I believe) shows:

<form action="#" method="POST" id="new-message-form">
<textarea name="new-message" id="new-message" cols="30" rows="2" placeholder="{{LANG write_message}}"></textarea>
<button type="submit" id="send-button"><svg xmlns="" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-arrow-right"><line x1="5" y1="12" x2="19" y2="12"></line><polyline points="12 5 19 12 12 19"></polyline></svg></button>
<input type="hidden" id="user-id" name="id" value="<?php echo $pt->chat_id; ?>">
<input type="hidden" id="user-avatar" value="<?php echo ($pt->chat_user->avatar) ? $pt->chat_user->avatar : "";?>">

Regarding adding this feature, I was sent this:

<form action="#" method="POST" id="new-message-form"> 
this is your form which is being submitted through Ajax here
url: '{{LINK aj/messages/new}}?hash=' + $('.main_session').val(),
data: {message_id: $('#message_id').val()},
now you have to get to your aj/messages/new file.

Can you help me determine what that instruction means, more clearly, please?
And if I need to add this code, to the existing form:

url: '{{LINK aj/messages/new}}?hash=' + $('.main_session').val(),
data: {message_id: $('#message_id').val()},

Any help will be appreciated.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.