Public
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Leader

Custom Private Message Button with Subject?

Calling all my html experts, devs, community hackers etc....is there a way to automagically populate a private message subject using a link/button?  For example, I have the following button...

 

<form action="/t5/notes/privatenotespage/tab/compose/note-to-user-id/41580" method="post"><button class="lia-button lia-button-primary" type="submit">Private Message Me</button></form>

...which would take you to the PM compose page...is there a way to insert a pre-selected/standard subject? In other words, we are trying to have a specific button/link auto-populate the PM subject, based on where the button is.

 

I know that we do this with Forum posts generated from our support site with the following url pattern:

https://community.virginmobileusa.com/t5/forums/postpage/choose-node/true?message-subject=abcdefg 

but "message-subject" does not appear to be a valid parameter for a <form> element in my first example.

 

What am I missing?



-Brien

3 Replies 3

Unlike forum post, you can not add message subject from URL. However, as a workaround you can get the subject value from URL and insert it to private message subject input using jQuery. 

 

 

Give kudos if you find my posts helpful or mark solution if it answers your query.
Tariq

Thanks @TariqHussain.

 

Any clues on how to do this in the context of a <form> or <button> ?

 

 



-Brien

@BHall - Create a component and add it to Notes Compose page. 

 

Freemarker 

<#assign subject = http.request.parameters.name.get("message.subject", "")?html />

jQuery

$(document).ready(function(){
  jQuery(".lia-form-subject-input.lia-form-type-text.lia-form-input-vertical").val("${subject}");
})

Once you will pass message.subject parameter with the subject, it will automatically be added to the subject input field. 

e.g https://community.lithium.com/t5/notes/composepage/note-to-user-id/53021?message.subject=Subject%20of%20message

Give kudos if you find my posts helpful or mark solution if it answers your query.
Tariq

Welcome to the Technology board!

Curious about our platform? Looking to connect on social technology? You've come to the right place!

Are you a Khoros customer? For direct assistance from our Support team, please visit the Support Forum.