<commit_before>package notifiers

import extensions.Email
import models.OrganizationConfiguration
import core.ThemeInfo
import play.api.i18n.{Messages, Lang}

/**
 * Email notifications
 *
 * @author <NAME> <<EMAIL>>
 */

object Mails {

  def activation(email: String, fullName: String, token: String, host: String)(implicit configuration: OrganizationConfiguration, lang: Lang) {
    val themeInfo = new ThemeInfo(configuration)
    Email(configuration.emailTarget.systemFrom, "Welcome to CultureHub").
      to(email).
      withContent(
      """
        |Hi %s !
        |
        |%s:
        |
        |http://%s/registration/activate/%s
      """.stripMargin.format(
            fullName,
            Messages("mail.message.activateaccount", themeInfo.siteName),
            host,
            token
          )
    ).send()
  }

  def newUser(subject: String, hub: String, userName: String, fullName: String, email: String)(implicit configuration: OrganizationConfiguration, lang: Lang) {
    Email(configuration.emailTarget.systemFrom, subject).
      to(configuration.emailTarget.exceptionTo).
      withContent(
      """
        |Master,
        |
        |a new awesome user registered on the CultureHub %s:
        |<commit_msg>Notifications of new users go to registration<commit_after>package notifiers

import extensions.Email
import models.OrganizationConfiguration
import core.ThemeInfo
import play.api.i18n.{Messages, Lang}

/**
 * Email notifications
 *
 * @author <NAME> <<EMAIL>>
 */

object Mails {

  def activation(email: String, fullName: String, token: String, host: String)(implicit configuration: OrganizationConfiguration, lang: Lang) {
    val themeInfo = new ThemeInfo(configuration)
    Email(configuration.emailTarget.systemFrom, "Welcome to CultureHub").
      to(email).
      withContent(
      """
        |Hi %s !
        |
        |%s:
        |
        |http://%s/registration/activate/%s
      """.stripMargin.format(
            fullName,
            Messages("mail.message.activateaccount", themeInfo.siteName),
            host,
            token
          )
    ).send()
  }

  def newUser(subject: String, hub: String, userName: String, fullName: String, email: String)(implicit configuration: OrganizationConfiguration, lang: Lang) {
    Email(configuration.emailTarget.systemFrom, subject).
      to(configuration.emailTarget.registerTo).
      bcc(configuration.emailTarget.exceptionTo).
      withContent(
      """
        |Master,
        |
        |a new awesome user registered on the CultureHub %s:
        |
{'fraction_non_alphanumeric': 0.1111111111111111, 'fraction_numerical': 0.0015594541910331384, 'mean_word_length': 2.790251107828656, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3275278', 'n_tokens_mistral': 699, 'n_tokens_neox': 685, 'n_words': 169}