<commit_before>  class MessagesController < ApplicationController

  include WithinOrganization

  before_action { @server = organization.servers.present.find_by_permalink!(params[:server_id]) }
  before_action { params[:id] && @message = @server.message_db.message(params[:id].to_i) }

  def new
    if params[:direction] == 'incoming'
      @message = IncomingMessagePrototype.new(@server, request.ip, 'web-ui', {})
      @message.from = session[:test_in_from] || current_user.email_tag
      @message.to = @server.routes.order(:name).first&.description
    else
      @message = OutgoingMessagePrototype.new(@server, request.ip, 'web-ui', {})
      @message.to = session[:test_out_to] || current_user.email_address
      if domain = @server.domains.verified.order(:name).first
        @message.from = "<EMAIL>@#{domain.<EMAIL>}"
      end
    end
    @message.subject = "Test Message at #{Time.now.to_s(:long)}"
    @message.plain_body = "This is a message to test the delivery of messages through Postal."
  end

  def create<commit_msg>make sure to use the user's time zone when composing test messages<commit_after>  class MessagesController < ApplicationController

  include WithinOrganization

  before_action { @server = organization.servers.present.find_by_permalink!(params[:server_id]) }
  before_action { params[:id] && @message = @server.message_db.message(params[:id].to_i) }

  def new
    if params[:direction] == 'incoming'
      @message = IncomingMessagePrototype.new(@server, request.ip, 'web-ui', {})
      @message.from = session[:test_in_from] || current_user.email_tag
      @message.to = @server.routes.order(:name).first&.description
    else
      @message = OutgoingMessagePrototype.new(@server, request.ip, 'web-ui', {})
      @message.to = session[:test_out_to] || current_user.email_address
      if domain = @server.domains.verified.order(:name).first
        @message.from = "test@#{domain.name}"
      end
    end
    @message.subject = "Test Message at #{Time.zone.now.to_s(:long)}"
    @message.plain_body = "This is a message to test the delivery of messages through Postal."
  end

  def create
{'fraction_non_alphanumeric': 0.13402061855670103, 'fraction_numerical': 0.0, 'mean_word_length': 4.09546539379475, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 5, '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': '4213363', 'n_tokens_mistral': 650, 'n_tokens_neox': 650, 'n_words': 136}