diff --git a/indra/llui/llnotifications.cpp b/indra/llui/llnotifications.cpp
index ebdb4d50244610e74f7df5d2ce611a5ad3d9664e..a5492b46f744ec5d43a7995536a0579d6fe37b14 100644
--- a/indra/llui/llnotifications.cpp
+++ b/indra/llui/llnotifications.cpp
@@ -279,6 +279,18 @@ bool LLNotificationForm::hasElement(const std::string& element_name) const
 	return false;
 }
 
+void LLNotificationForm::getElements(LLSD& elements, S32 offset)
+{
+    //Finds elements that the template did not add
+    LLSD::array_const_iterator it = mFormData.beginArray() + offset;
+
+    //Keeps track of only the dynamic elements
+    for(; it != mFormData.endArray(); ++it)
+    {
+        elements.append(*it);
+    }
+}
+
 bool LLNotificationForm::getElementEnabled(const std::string& element_name) const
 {
 	for (LLSD::array_const_iterator it = mFormData.beginArray();
@@ -320,11 +332,6 @@ void LLNotificationForm::addElement(const std::string& type, const std::string&
 	mFormData.append(element);
 }
 
-void LLNotificationForm::addElement(const LLSD& element)
-{
-    mFormData.append(element);
-}
-
 void LLNotificationForm::append(const LLSD& sub_form)
 {
 	if (sub_form.isArray())
@@ -508,21 +515,36 @@ LLNotification::LLNotification(const LLSDParamAdapter<Params>& p) :
 }
 
 
-LLSD LLNotification::asLLSD()
+LLSD LLNotification::asLLSD(bool excludeTemplateElements)
 {
 	LLParamSDParser parser;
 
 	Params p;
 	p.id = mId;
 	p.name = mTemplatep->mName;
-	p.form_elements = getForm()->asLLSD();
-	
 	p.substitutions = mSubstitutions;
 	p.payload = mPayload;
 	p.time_stamp = mTimestamp;
 	p.expiry = mExpiresAt;
 	p.priority = mPriority;
 
+    LLNotificationFormPtr templateForm = mTemplatep->mForm;
+    LLSD formElements = mForm->asLLSD();
+
+    //All form elements (dynamic or not)
+    if(!excludeTemplateElements)
+    {
+        p.form_elements = formElements;
+    }
+    //Only dynamic form elements (exclude template elements)
+    else if(templateForm->getNumElements() < formElements.size())
+    {
+        LLSD dynamicElements;
+        //Offset to dynamic elements and store them
+        mForm->getElements(dynamicElements, templateForm->getNumElements());
+        p.form_elements = dynamicElements;
+    }
+    
     if(mResponder)
     {
         p.functor.responder_sd = mResponder->asLLSD();
@@ -823,18 +845,7 @@ void LLNotification::init(const std::string& template_name, const LLSD& form_ele
 	//mSubstitutions["_ARGS"] = get_all_arguments_as_text(mSubstitutions);
 
 	mForm = LLNotificationFormPtr(new LLNotificationForm(*mTemplatep->mForm));
-
-    //Prevents appending elements(buttons) that the template already had
-    if(form_elements.isArray()
-        && mForm->getNumElements() < form_elements.size())
-    {
-        LLSD::array_const_iterator it = form_elements.beginArray() + mForm->getNumElements();;
-
-        for(; it != form_elements.endArray(); ++it)
-        {
-            mForm->addElement(*it);
-        }
-    }
+    mForm->append(form_elements);
 
 	// apply substitution to form labels
 	mForm->formatElements(mSubstitutions);
diff --git a/indra/llui/llnotifications.h b/indra/llui/llnotifications.h
index 96e0a86b7f367ccb39450be64bc6e1032c561394..236c2a42d18a972f764b7482181f94fd87f2489e 100644
--- a/indra/llui/llnotifications.h
+++ b/indra/llui/llnotifications.h
@@ -242,11 +242,11 @@ class LLNotificationForm
 	S32 getNumElements() { return mFormData.size(); }
 	LLSD getElement(S32 index) { return mFormData.get(index); }
 	LLSD getElement(const std::string& element_name);
+    void getElements(LLSD& elements, S32 offset = 0);
 	bool hasElement(const std::string& element_name) const;
 	bool getElementEnabled(const std::string& element_name) const;
 	void setElementEnabled(const std::string& element_name, bool enabled);
 	void addElement(const std::string& type, const std::string& name, const LLSD& value = LLSD(), bool enabled = true);
-    void addElement(const LLSD &element);
 	void formatElements(const LLSD& substitutions);
 	// appends form elements from another form serialized as LLSD
 	void append(const LLSD& sub_form);
@@ -457,7 +457,7 @@ friend class LLNotifications;
 	// ["time"] = time at which notification was generated;
 	// ["expiry"] = time at which notification expires;
 	// ["responseFunctor"] = name of registered functor that handles responses to notification;
-	LLSD asLLSD();
+	LLSD asLLSD(bool excludeTemplateElements = false);
 
 	const LLNotificationFormPtr getForm();
 	void updateForm(const LLNotificationFormPtr& form);
diff --git a/indra/newview/lldonotdisturbnotificationstorage.cpp b/indra/newview/lldonotdisturbnotificationstorage.cpp
index 9bb2f27a4628b0ca28d8aa7d18b7326e6e642bf5..ac41a3804ff6aa37a9a5e3d54e956b83cdfe4b2f 100644
--- a/indra/newview/lldonotdisturbnotificationstorage.cpp
+++ b/indra/newview/lldonotdisturbnotificationstorage.cpp
@@ -77,7 +77,7 @@ void LLDoNotDisturbNotificationStorage::saveNotifications()
 
 		if (!notificationPtr->isRespondedTo() && !notificationPtr->isCancelled() && !notificationPtr->isExpired())
 		{
-			data.append(notificationPtr->asLLSD());
+			data.append(notificationPtr->asLLSD(true));
 		}
 	}