Answers.Body: <p>I think how these options work</p>
  
  <p><strong>Maximum Attachments</strong></p>
  
  <p>This options is used to build number of attachment on offline forms like Sending Email in the form activities etc. Till now its handled on All email forms, Note, Activity, Campaign and Grant. Setting 0 means no attachment field on all those forms.</p>
  
  <p><strong>Maximum Attachments For Backend Processes</strong></p>
  
  <p>This options is used to process number of files can be saved in the system. This are handled in  Note, Activity, Campaign and Grant. Setting this option will limit the number of attachment stored for the entity. Setting 0 means no files will be stored in database or system. This option will restrict sending while sending email as an activity. However the same option is used to restrict files when saving Mailing(will work incase mailing created via api or cloned) but the UI forms explicitly calls separate function to attach files where this setting option is not respected till now.</p>
  
  <p>There is also no UI setting to hide the attachment tab for Mailings so its down to customization. You can do this by one of the following method</p>
  
  <ol>
  <li>Hide using css</li>
  </ol>
  
  <p>code:</p>
  
  <pre><code>form[name='crmMailing'] li[aria-controls='tab-attachment'] {
      display: none;
  }
  </code></pre>
  
  <ol start="2">
  <li>Hide/remove using JS</li>
  </ol>
  
  <p>code:</p>
  
  <pre><code>$("form[name='crmMailing'] li[aria-controls='tab-attachment']").remove(); 
  OR 
  $("form[name='crmMailing'] li[aria-controls='tab-attachment']").hide();
  </code></pre>
  
  <ol start="3">
  <li><p>Remove the Attachment tab using <a href="https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_alterAngular/" rel="nofollow noreferrer">hook_civicrm_alterAngulars()</a></p></li>
  <li><p>Remove attachment while sending email using <a href="https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_alterMailParams/" rel="nofollow noreferrer">hook_civicrm_alterMailParams()</a></p></li>
  </ol>
  
  <p>HTH</p>
  
  <p>Pradeep</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-04-08T21:12:21.130Z
Answers.LastActivityDate: 2020-04-08T21:12:21.130Z
Answers.UserDisplayName: Pradeep Nayak
Answers.Body: <p>I don't think either of those settings would help prevent attachments for mailings. The first one the help text says "Maximum number of files (documents, images, etc.) which can be attached to emails or activities. This setting applies to UI forms and limits the number of fields available on the form." Setting it to 0 does remove the attachments field from activities, but the setting's not used I guess for mailings.</p>
  
  <p>The second setting won't help. It's for things like the inbound email processor and is just a sanity/denial-of-service prevention limit.</p>
  
  <p>I think this would need to be a customization.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-04-08T20:31:20.240Z
Answers.LastActivityDate: 2020-04-08T20:31:20.240Z
Answers.UserDisplayName: Demerit
Body: <p>I want to remove the ability to add attachments. Particularly, it should not be used for CiviMail as it's a great way to hurt email reputation and is simply unnecessary. I would rather load into my CMS media library and then add it into CiviMail via a hyperlink or image. I suppose I could argue that this option shouldn't even exist in CiviMail.</p>
  
  <p>In <strong>Misc (Undelete, PDFs, Limits, Logging, Captcha, etc.)</strong> there are two options for attachments. </p>
  
  <p><em>Maximum Attachments</em></p>
  
  <p><em>Maximum Attachments For Backend Processes</em> </p>
  
  <p>Does <em>Maximum Attachments</em> mean only for front end forms?</p>
  
  <p>To prevent attachments from being used, I set both to 0. I also tried to set this with an override in civicrm.settings.php but it does not accept a 0, so I tried -1 and that 'save right' but still had no effect.</p>
  
  <p>What are those settings effecting then if not CiviMail? How can I remove attachment functionality? My last resort is removing the option thru a tpl.extra. I would prefer not to do that and fix it at the source.</p>
  
Tags: <civimail><email><attachments>
Title: Remove ability to add email attachments
ThreadText: # Remove ability to add email attachments
  
  (Asked by: username_0 on 2020-04-08)
  
  I want to remove the ability to add attachments. Particularly, it should not be used for CiviMail as it's a great way to hurt email reputation and is simply unnecessary. I would rather load into my CMS media library and then add it into CiviMail via a hyperlink or image. I suppose I could argue that this option shouldn't even exist in CiviMail.
  
  In **Misc (Undelete, PDFs, Limits, Logging, Captcha, etc.)** there are two options for attachments.
  
  *Maximum Attachments*
  
  *Maximum Attachments For Backend Processes*
  
  Does *Maximum Attachments* mean only for front end forms?
  
  To prevent attachments from being used, I set both to 0. I also tried to set this with an override in civicrm.settings.php but it does not accept a 0, so I tried -1 and that 'save right' but still had no effect.
  
  What are those settings effecting then if not CiviMail? How can I remove attachment functionality? My last resort is removing the option thru a tpl.extra. I would prefer not to do that and fix it at the source.
  
  **Tags:** civimail, email, attachments
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2020-04-08. Score: 1 | Accepted answer
  
  I think how these options work
  
  **Maximum Attachments**
  
  This options is used to build number of attachment on offline forms like Sending Email in the form activities etc. Till now its handled on All email forms, Note, Activity, Campaign and Grant. Setting 0 means no attachment field on all those forms.
  
  **Maximum Attachments For Backend Processes**
  
  This options is used to process number of files can be saved in the system. This are handled in Note, Activity, Campaign and Grant. Setting this option will limit the number of attachment stored for the entity. Setting 0 means no files will be stored in database or system. This option will restrict sending while sending email as an activity. However the same option is used to restrict files when saving Mailing(will work incase mailing created via api or cloned) but the UI forms explicitly calls separate function to attach files where this setting option is not respected till now.
  
  There is also no UI setting to hide the attachment tab for Mailings so its down to customization. You can do this by one of the following method
  
  1. Hide using css
  
  code:
  
  ```
  form[name='crmMailing'] li[aria-controls='tab-attachment'] {
      display: none;
  }
  
  ```
  
  2. Hide/remove using JS
  
  code:
  
  ```
  $("form[name='crmMailing'] li[aria-controls='tab-attachment']").remove(); 
  OR 
  $("form[name='crmMailing'] li[aria-controls='tab-attachment']").hide();
  
  ```
  
  3. Remove the Attachment tab using [hook\_civicrm\_alterAngulars()](https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_alterAngular/)
  4. Remove attachment while sending email using [hook\_civicrm\_alterMailParams()](https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_alterMailParams/)
  
  HTH
  
  username_1
  
  
  ---
  
  ### Answer by username_2 on 2020-04-08. Score: 1
  
  I don't think either of those settings would help prevent attachments for mailings. The first one the help text says "Maximum number of files (documents, images, etc.) which can be attached to emails or activities. This setting applies to UI forms and limits the number of fields available on the form." Setting it to 0 does remove the attachments field from activities, but the setting's not used I guess for mailings.
  
  The second setting won't help. It's for things like the inbound email processor and is just a sanity/denial-of-service prevention limit.
  
  I think this would need to be a customization.
  
  
  ---
  
  