/**
  * Deletes the email templates that belong to the specified add-on.
  *
  * @param string $addOnId
  */
 public function deleteEmailTemplatesForAddOn($addOnId)
 {
     $templates = $this->getMasterEmailTemplateTitlesByAddOn($addOnId);
     $titles = array_keys($templates);
     if ($titles) {
         $db = $this->_getDb();
         $quotedTitles = $db->quote($titles);
         $db->delete('xf_email_template', "title IN ({$quotedTitles}) AND custom = 0");
         $db->delete('xf_email_template_compiled', "title IN ({$quotedTitles})");
         $db->delete('xf_email_template_phrase', "title IN ({$quotedTitles})");
     }
     XenForo_Template_Compiler_Email::resetTemplateCache();
 }
 /**
  * Deletes the email templates that belong to the specified add-on.
  *
  * @param string $addOnId
  */
 public function deleteEmailTemplatesForAddOn($addOnId)
 {
     $templates = $this->getMasterEmailTemplateTitlesByAddOn($addOnId);
     $titles = array_keys($templates);
     if ($titles) {
         $db = $this->_getDb();
         $quotedTitles = $db->quote($titles);
         $templateIds = array();
         foreach ($templates as $template) {
             $templateIds[] = $template['template_id'];
         }
         $quotedIds = $db->quote($templateIds);
         $db->delete('xf_email_template', "title IN ({$quotedTitles}) AND custom = 0");
         $db->delete('xf_email_template_compiled', "title IN ({$quotedTitles})");
         $db->delete('xf_email_template_phrase', "title IN ({$quotedTitles})");
         $db->delete('xf_email_template_modification_log', "template_id IN ({$quotedIds})");
     }
     XenForo_Template_Compiler_Email::resetTemplateCache();
 }