<commit_before>class DonationMailer < ApplicationMailer
  default from: "<EMAIL>"

  # def sample_email(donation)
  # 	@donation = donation
  # 	@donor = @donation.user
  # 	@rider = @donation.rider
  # 	mail(to: @donor.email, subject: 'foo bar baz?')
  # end

  def successful_donation_alert_rider(donation)
  	@donation = donation
  	@donor = @donation.user
  	@rider = @donation.rider
  	@prp = @rider.persistent_rider_profile
  	@percent_of_goal = @prp.delegate_ryr_method(RideYear.current, 'percent_of_goal')
    # subject: "Donation received from #{@donor.full_name}"
  	mail(to: @donor.email) do |format|
      format.html do
        string = render_to_string("successful_donation_alert_rider")
        p '#'*80
        p "#{string.inspect}"
        return string
      end
    end
  end

  def successful_donation_thank_donor(donation)
  	@donation = donation
  	@receipt = @donation.receipt
  	@donor = @donation.user
    org = donation.is_organizational
    unless org
  	 @rider = @donation.rider
     @prp = @rider.persistent_rider_profile
    end
  	mail(to: @donor.email, subject: "Receipt for donation to #{org ? 'IMPJ' : @rider.full_name}")
  end
end<commit_msg>stuck with action mailer configure, alerting donor. no worky, while alerting rider recipient works fine.<commit_after>class DonationMailer < ApplicationMailer
  default from: "<EMAIL>"

  def sample_email(donation)
  	@donation = donation
  	@donor = @donation.user
  	@rider = @donation.rider
  	mail(to: @donor.email, subject: 'foo bar baz?')
  end

  def successful_donation_alert_rider(donation)
  	@donation = donation
  	@donor = @donation.user
  	@rider = @donation.rider
  	@prp = @rider.persistent_rider_profile
  	@percent_of_goal = @prp.delegate_ryr_method(RideYear.current, 'percent_of_goal')
  	mail(to: @donor.email, subject: "Donation received from #{@donor.full_name}")
  end

  def successful_donation_thank_donor(donation)
  	@donation = donation
  	@receipt = @donation.receipt
  	@donor = @donation.user
    org = donation.is_organizational
    unless org
  	 @rider = @donation.rider
     @prp = @rider.persistent_rider_profile
    end
  	mail(to: @donor.email, subject: "Receipt for donation to #{org ? 'IMPJ' : @rider.full_name}")
  end
end
{'fraction_non_alphanumeric': 0.11155734047300313, 'fraction_numerical': 0.000892458723784025, 'mean_word_length': 3.8633405639913234, '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': '901423', 'n_tokens_mistral': 855, 'n_tokens_neox': 828, 'n_words': 169}