# HG changeset patch
# User Jorg K
# Date 1463225697 -7200
#      Sat May 14 13:34:57 2016 +0200
# Branch THUNDERBIRD3880_2016050308_RELBRANCH
# Node ID cf8713238bf38ff8f606236d0b8e83be72702675
# Parent  5d4558af351a1fd5cb96629c9e76494406a62231
Bug 1270149 - Don't clobber options when using a template. r=mkmelin a=rkent (with no test)

diff --git a/mailnews/compose/src/nsMsgCompose.cpp b/mailnews/compose/src/nsMsgCompose.cpp
--- a/mailnews/compose/src/nsMsgCompose.cpp
+++ b/mailnews/compose/src/nsMsgCompose.cpp
@@ -938,17 +938,17 @@
     nsAutoCString draftId; // will get set for drafts and templates
     rv = composeFields->GetDraftId(getter_Copies(draftId));
     NS_ENSURE_SUCCESS(rv,rv);
 
     // Set return receipt flag and type, and if we should attach a vCard
     // by checking the identity prefs - but don't clobber the values for
     // drafts and templates as they were set up already by mime when
     // initializing the message.
-    if (m_identity && draftId.IsEmpty())
+    if (m_identity && draftId.IsEmpty() && type != nsIMsgCompType::Template)
     {
       bool requestReturnReceipt = false;
       rv = m_identity->GetRequestReturnReceipt(&requestReturnReceipt);
       NS_ENSURE_SUCCESS(rv, rv);
       rv = composeFields->SetReturnReceipt(requestReturnReceipt);
       NS_ENSURE_SUCCESS(rv, rv);
 
       int32_t receiptType = nsIMsgMdnGenerator::eDntType;
