I am attempting to set the "From" field in a new Email activity related to a Case. I would like to have the default "From" field be the mailbox of the queue where the Case is currently related, instead of the current user's email.
Cases are being created automatically from emails sent to mailboxes and then routed to the appropriate queue to be worked on by users. The systems has roughly a dozen queues associated with different mailboxes.
At a high level the requirement is:
- User selects a Case from a queue for which they are a member
- User selects to create a new email related to the case, or clicks reply/forward to an email in the Case timeline
- On the new mail form, the From field should default to the Queue mailbox
I have been able to set the From field to a specific queue mailbox using a web resource that is triggered by the Onload event of the Email Form. However, the queue name is hardcoded in the JavaScript. I am struggling to find a way to either pass the current queue to the web resource as a parameter or pull the current queue from the ExecutionContext.
Would appreciate any suggestions/ideas.
Below is the code I amusing to set the From field (value in red is hard coded and I want it to be dynamic):