Answers.Body: <p>I ended up adding a small bit of javascript that waits for Angular to build the form, then it disables the checkboxes. Don't know if it's the right way, but it works.</p>
  
  <pre><code>CRM.$(function($) {
  
  function disable_tracking() {
      var i = $('#tab-tracking').length;
  
      if (i &gt; 0) {
          $('input[name="url_tracking"]').attr('disabled', true);
          $('input[name="open_tracking"]').attr('disabled', true);
      }
      else setTimeout(disable_tracking, 250);
  }
  
  if ( (typeof(CRM.crmMailing) == 'object') &amp;&amp; (CRM.vars.sendgrid.track_optional == '0') )
      disable_tracking();
  </code></pre>
  
  <p>})</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-10-26T10:56:40.817Z
Answers.Text: Possible to share the JS code here? We are stuck with a similar problem and your code might help. Thanks
Answers.UserDisplayName: Ghost
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-10-27T13:27:45.940Z
Answers.Text: Just added the code to my answer. Hope it helps.
Answers.UserDisplayName: konadave
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-08-13T18:37:58.817Z
Answers.LastActivityDate: 2015-10-27T13:27:09.483Z
Answers.LastEditDate: 2015-10-27T13:27:09.483Z
Answers.UserDisplayName: konadave
Body: <p>I am the author of a CiviCRM extension that needs to disable, depending on configuration, the URL tracking and open tracking checkboxes of the mailing form. In version 4.4 this was accomplished using hook_civicrm_buildForm (CRM_Mailing_Form_Settings) and calling the freeze method on those elements.</p>
  
  <p>This form hook is not getting called in version 4.6, so how would I go about doing this now?</p>
  
  <p>Thanks for looking.</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-04-05T07:20:28.327Z
Comments.Text: You might want to look at http://civicrm.stackexchange.com/questions/9062/how-to-change-mailing-form-and-set-the-default-value-for-url-tracking-to-false and http://civicrm.stackexchange.com/questions/10391/adding-dynamic-data-in-civimail-angular-template
Comments.UserDisplayName: michaelmcandrew
Tags: <civimail><extension><hooks><developer>
Title: How do I modify the new 4.6 CiviMail form?
ThreadText: # How do I modify the new 4.6 CiviMail form?
  
  (Asked by: username_0 on 2015-08-13)
  
  I am the author of a CiviCRM extension that needs to disable, depending on configuration, the URL tracking and open tracking checkboxes of the mailing form. In version 4.4 this was accomplished using hook\_civicrm\_buildForm (CRM\_Mailing\_Form\_Settings) and calling the freeze method on those elements.
  
  This form hook is not getting called in version 4.6, so how would I go about doing this now?
  
  Thanks for looking.
  
  **Tags:** civimail, extension, hooks, developer
  
  > **Comments:**
  > **username_1**: You might want to look at http://civicrm.stackexchange.com/questions/9062/how-to-change-mailing-form-and-set-the-default-value-for-url-tracking-to-false and http://civicrm.stackexchange.com/questions/10391/adding-dynamic-data-in-civimail-angular-template  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2015-08-13. Score: 3
  
  I ended up adding a small bit of javascript that waits for Angular to build the form, then it disables the checkboxes. Don't know if it's the right way, but it works.
  CRM.$(function($) {
  
  function disable_tracking() {
      var i = $('#tab-tracking').length;
  
      if (i > 0) {
          $('input[name="url_tracking"]').attr('disabled', true);
          $('input[name="open_tracking"]').attr('disabled', true);
      }
      else setTimeout(disable_tracking, 250);
  }
  
  if ( (typeof(CRM.crmMailing) == 'object') && (CRM.vars.sendgrid.track_optional == '0') )
      disable_tracking();
  
  })
  
  > **Comments:**
  > **username_2**: Possible to share the JS code here? We are stuck with a similar problem and your code might help. Thanks  
  > **username_0**: Just added the code to my answer. Hope it helps.  
  
  ---
  
  