Updating merge tags for the edit page
authorSteve Sutton <steve@gaslightmedia.com>
Wed, 28 Aug 2019 19:05:29 +0000 (15:05 -0400)
committerSteve Sutton <steve@gaslightmedia.com>
Wed, 28 Aug 2019 19:05:29 +0000 (15:05 -0400)
Setup display hide of merge tag.

models/admin/messages/index.php
models/admin/messages/sendMessagesEmails.php
views/admin/messages/editHtmlEmail.html

index 2177f94..9c182d1 100644 (file)
@@ -199,6 +199,7 @@ class GlmMembersAdmin_messages_index extends GlmDataEmailMessages
                     'start'   => $start,
                     'limit'   => $limit,
                     'stats'   => true,
+                    'order'   => 'send_date DESC',
                 ]
             );
             $statCount = $statsData['stats'];
index 8bb1853..53cb28c 100644 (file)
@@ -186,7 +186,7 @@ class GlmMembersAdmin_messages_sendMessagesEmails //extends GlmDataRegistrations
         // Set the From name using this wordpress hook.
         add_filter(
             'wp_mail_from_name',
-            function ( $name ) {
+            function ( $fromName ) {
                 return $fromName;
             }
         );
index d8fe17d..259b44f 100644 (file)
 
 {* Form Start *}
 {$ui = [
-    'id'               => 'edit-email-message',
-    'action'           => "{$thisUrl}?page={$thisPage}",
-    'method'           => 'post',
-    'file'             => true,
-    'validate'         => true,
-    'validateFocusMsg' => true
+    'id'                     => 'edit-email-message',
+    'action'                 => "{$thisUrl}?page={$thisPage}",
+    'method'                 => 'post',
+    'file'                   => true,
+    'validate'               => true,
+    'validateFocusMsg'       => true,
+    'leaveModifiedFormCheck' => true
 ]}
 {include file='ui/f6/form-start.html'}
 
 
     <fieldset class="fieldset cell small-12">
         <legend>Email Message</legend>
+
+        <div class="callout hide" id="merge-tags">
+            <strong>Merge Tags</strong>
+            <p>The "merge tags" listed below may be used in the email message to include certain information about the Member or Contact. Be sure to include the "{" and "}" and "$" characters exactly as shown.</p>
+
+            <div class="grid-x grid-margin-x">
+                <div class="cell small-12">
+                    {$tData = $merge_tags}
+                    {html_table loop=$tData cols=2 table_attr='border=0 style=width: 400px;' caption='Merge Tags Examples' td_attr=['align="left"','align="left"']}
+                </div>
+            </div>
+        </div>
+
+        <button class="button secondary float-right" id="glm-merge-tag-button">Merge Tags</button>
+
         {* Message Content *}
         {$ui = [
             'value'     => $data.fieldData.message_body,
 
     </div>
 
-    <fieldset class="fieldset cell small-12 medium-6">
-        <legend>Merge Tags</legend>
-
-        {assign var="tData" value=$merge_tags}
-
-        <strong>Merge Tags</strong>
-        <p>The "merge tags" listed below may be used in the email message to include certain information about the Member or Contact. Be sure to include the "{" and "}" and "$" characters exactly as shown.</p>
-
-        <div class="grid-x grid-margin-x">
-            <div class="cell small-12">
-                {html_table loop=$tData cols=2 table_attr='border=0 style=width: 400px;' caption='Merge Tags Examples' td_attr=['align="left"','align="left"']}
-            </div>
-        </div>
-
-    </fieldset>
-
 </div>
 
 {* Form End *}
 <script>
 jQuery(document).ready(function($){
     $(document).foundation();
+
+    $('#glm-merge-tag-button').on( 'click', function(e){
+        e.preventDefault();
+        $('#merge-tags').toggleClass('hide');
+    });
 });
 </script>