<commit_before>require_relative "../config/postmark"
class Email

  def self.send_email(template_name, pr, comment=nil)
    templates = {
      "approval-requested"  => 438823,
      "approved"            => 438922,
      "rejected"            => 438821,
      "admin-comment-added" => 438822,
      "revise-and-resubmit" => 438823
    }
    template_model = {
      name:         pr.submitterName,
      URL:          "http://commonstandardsproject.com/edit/pull-requests/" + pr.id,
      jurisdiction: pr.standardSet.jurisdiction.title,
      subject:      pr.standardSet.subject,
      title:        pr.standardSet.title,
    }
    template_model[:comment] = {text: comment} if comment

    PostmarkClient.deliver_with_template(
      from: '<EMAIL>',
      to: "#{pr.submitterName} <#{pr.submitterEmail}>",
      template_id: templates[template_name],
      template_model: template_model
    )
  end

end
<commit_msg>Updated the template ids<commit_after>require_relative "../config/postmark"
class Email

  def self.send_email(template_name, pr, comment=nil)
    templates = {
      "approval-requested"  => 3694442,
      "approved"            => 3694223,
      "rejected"            => 3694422,
      "admin-comment-added" => 3694441,
      "revise-and-resubmit" => 3694421
    }
    template_model = {
      name:         pr.submitterName,
      URL:          "http://commonstandardsproject.com/edit/pull-requests/" + pr.id,
      jurisdiction: pr.standardSet.jurisdiction.title,
      subject:      pr.standardSet.subject,
      title:        pr.standardSet.title,
    }
    template_model[:comment] = {text: comment} if comment

    PostmarkClient.deliver_with_template(
      from: '<EMAIL>',
      to: "#{pr.submitterName} <#{pr.submitterEmail}>",
      template_id: templates[template_name],
      template_model: template_model
    )
  end

end

{'fraction_non_alphanumeric': 0.12365591397849462, 'fraction_numerical': 0.03494623655913978, 'mean_word_length': 2.524621212121212, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3658831', 'n_tokens_mistral': 639, 'n_tokens_neox': 587, 'n_words': 99}