We use a URL hack in a JavaScript button to set the From field on Email Messages based on a custom field on the Case. The hack is:
location.replace('/email/author/emailauthor.jsp?retURL=/{!Case.Id}&p3_lkid={!Case.Id}&rtype=003&p2_lkid={!Case.ContactId}&p26={!Case.From_Email__c}')
All the replacements work except for the final one &p26={!Case.From_Email__c} and it only fails for one user.
I can see the correct dynamic values in the URL in the browser including the email address but the email address that appears in the From field is not from the URL. When there is only text (a "no email found" value) in the URL instead of an email address, the replacement works for this user.
I've tested the behavior logged in as a user with the exact same Profile on the exact same Cases: The URL replaces the From email correctly as expected.
The URL is built from the Salesforce-provided one that is seen on the Emails related list on Cases, with the addition of the From field, p26.
<label for="p26"><span class="assistiveText">*</span>From</label></td><td class="data2Col" colspan="3"><div class="requiredInput"><div class="requiredBlock"></div><select id="p26" name="p26">
I do also see that the email in the URL does appear as the selected option value but the displayed text is different.
<option value="[email protected]" selected="selected">"Another Address" <[email protected]></option>
Any suggestions about what could cause this for just one user and only for email addresses? Other ways to test this or trap the error?
p26
a bit myself - are you populating it with an org-wide address, or an e-mail-to-case address? It has to come through with the same colon-delimited formatting as you see from inspecting the From selector in your browser, eg,0D270000000gyVTBAZ:[email protected]:Luke FTW
for a org-wide or[email protected]:Luke FTW
for a e2c. And for org wide, requires permission, of course.