There are a few glitches in the Edit --> Variables > menu items. In particular, the "First Name" option extracts Last Name, not First Name.
STEPS TO REPRODUCE
1. Open the Composer, fill in "To:" and "CC:" fields ("From:" is pre-filled).
2. Position the cursor somewhere in the main Composer window.
3. Select menu item Edit --> Variable > To > To Field First Name (or ... CC > CC
Field First Name, or ... From > From Field First Name).
The selected menu item inserts the person's last name.
I expected this function to insert the person's first name, as advertised.
Linux/KDE Plasma: Yes!
(available in About System)
KDE Plasma Version: 5.20.5
KDE Frameworks Version: 5.77.0
Qt Version: 5.15.2
I ran across this bug while working on the documentation update project. There are a couple of other problems with "Variables >" ... check out "Edit --> Variables > Attachments > Names and Sizes" (appends the literal value "AND SIZES" to the list of attachments' names ... I expected to see the size of each attachment, sort of the way sizes are displayed in the list of attachments underneath the main Composer window) and also try "Edit --> Variables > Date/Time > Time" (appends the literal value "LONG" to hh:mm:ss AM/PM, where I expected to see, e.g., "GMT" or "UTC" or "CDT").
See the attached screenshot, where I tried each of the four options (Address, Last Name, First Name, Name) for "To >", "From >", and "CC >", respectively. First Name and Last Name are stored as separate fields in KAddressBook, and "Name" includes both a person's first and last names, so these functions work almost right ... only the "First Name" option is misbehaving.
Created attachment 137388 [details]
Screenshot from Composer window, illustrating the bug.
Git commit 1d14ddb598cda4a9afaddd8be257b1e91c1d8d23 by Laurent Montel.
Committed on 07/04/2021 at 05:46.
Pushed by mlaurent into branch 'release/21.04'.
Fix BUG 435431 Edit menu (Variables submenu) doesn't work as advertised
M +1 -1 messagecomposer/src/snippet/convertsnippetvariablesjob.cpp