Bug 219002

Summary: Templates aren't used correctly for new mails when switching the identities
Product: [Applications] kmail2 Reporter: DaB. <kde>
Component: generalAssignee: kdepim bugs <kdepim-bugs>
Status: RESOLVED FIXED    
Severity: normal CC: cwickert, luigi.toscano, montel, rdieter
Priority: NOR    
Version: 4.8.5   
Target Milestone: ---   
Platform: unspecified   
OS: Linux   
See Also: https://bugs.kde.org/show_bug.cgi?id=151238
Latest Commit: Version Fixed In: 4.10

Description DaB. 2009-12-17 00:49:39 UTC
Version:           1.12.2 (using 4.3.2 (KDE 4.3.2), Debian packages)
Compiler:          cc
OS:                Linux (i686) release 2.6.30-1-686

I defined a new-email-template for an identity, which is not the default-identity. When I like to create a new email, a new window with the default-identity-template is open (logical). But if I switch the identidy, the text is not changed to the template of the (then switched) identity, but it remains on the default.

I guess the right reaction would be, that the text from the template of the identity is insert (as long as no text was insert allready).

Sincerly,
DaB.
Comment 1 Christoph Wickert 2010-03-31 22:34:38 UTC
I can confirm this with kdepim 4.4.1 on Fedora 12. I'm not sure if it is feasible to update the message body when the identity is changed because I'm afraid that text gets lost that one has typed before switching.

I think it might be better to first select the identity and then open the composer window, something like "Reply as... -> <Accountname>" in the context menu. This was already proposed in bug 151238.
Comment 2 DaB. 2010-03-31 23:21:14 UTC
It works with kde 4.3.4 now under debian now. Are you sure that doesn't work with 4.4.1?
Comment 3 Christoph Wickert 2010-04-01 00:43:02 UTC
You are correct, it works after I fixed the problems mentioned in bug 184307.

However the behavior is inconsistent. Example: Configure 2 identities, foo (default) and bar.

foo template for reply:
%BLANK

bar template for reply:
%QUOTE

%CURSOR


Test cases:
1. New reply. Switch from foo to bar and back again, if you haven't typed anything yet: Quote is removed and added as expected.

2. New reply: Type something, then switch to bar. The quote is not added.

3. New reply as bar: Type something, then switch to bar. The quote is not removed.

4. Reply as foo or bar: Type something, then switch to foo and back again. With every switch from foo to bar, a blank line is added. I guess this is the line between %BLANK and %QUOTE in bar's template.

Cases 2 and 3 are strange, but 4 is completely illogical, especially when you started as foo, because according to the result of case 2, the template with the quote should not be applied at all.
Comment 4 Luigi Toscano 2012-08-22 21:04:26 UTC
Confirmed by Christoph Wickert, the behavior described in comment 3 still applies.
Comment 5 Laurent Montel 2012-11-15 12:13:42 UTC
Fixed in 4.10