private string DoDonationModifyMessage(string message)
{
var p = List[donor ?? 0];
Transaction.Fund = p.setting.DonationFund();
var desc = $"{p.person.Name}; {p.person.PrimaryAddress}; {p.person.PrimaryCity}, {p.person.PrimaryState} {p.person.PrimaryZip}";
if (!Transaction.TransactionId.StartsWith("Coupon") && Transaction.Donate.HasValue)
{
p.person.PostUnattendedContribution(DbUtil.Db, Transaction.Donate.Value, p.setting.DonationFundId, desc,
tranid: Transaction.Id);
Log("ExtraDonation");
}
var subject = GetSubject(p);
var ma = donationtext.Match(message);
if (ma.Success)
{
var v = ma.Groups["text"].Value;
message = donationtext.Replace(message, v);
}
message = message.Replace("{donation}", Transaction.Donate.ToString2("N2"));
// send donation confirmations
var notifyIds = GetNotifyIds(p);
var notice = $"${Transaction.Donate:N2} donation received from {Transaction.FullName(Transaction)} on behalf of {p.person.Name}";
DbUtil.Db.Email(notifyIds[0].FromEmail, notifyIds, subject + "-donation", notice);
return message;
}