I have tried 20+ code variations and can’t seem to get this working. Scoured here, stackoverflow and everything else I can find over the last month without a solution. Some appeared to work in prior versions but not now.
As the title says; would like these files attached to the email when it sends:

Single code file I named POOrderEntry_Extension:
using PX.Data;
using PX.Objects.CR;
using PX.Objects.PO;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
namespace Customizations
{
[PXProtectedAccess]
public abstract class POOrderEntry_Extension : PXGraphExtension<POOrderEntry>
{
[PXProtectedAccess]
protected abstract IEnumerable Notification(PXAdapter adapter, string notificationCD);
public delegate IEnumerable NotificationDelegate(PXAdapter adapter, string notificationCD);
[PXOverride]
public IEnumerable Notification(PXAdapter adapter, string notificationCD, NotificationDelegate baseMethod)
{
IEnumerable result = baseMethod(adapter, notificationCD);
POOrder order = Base.Document.Current;
if (order?.NoteID == null)
return result;
CRSMEmail email = PXSelect<CRSMEmail,
Where<CRSMEmail.refNoteID, Equal<Required<CRSMEmail.refNoteID>>>>
.Select(Base, order.NoteID);
if (email == null)
return result;
var fileUids = PXNoteAttribute.GetFileNotes(Base.Document.Cache, order)?
.OfType<Guid>()
.ToArray();
if (fileUids != null && fileUids.Length > 0)
{
PXNoteAttribute.SetFileNotes(Base.Caches<CRSMEmail>(), email, fileUids);
Base.Caches<CRSMEmail>().Update(email);
}
return result;
}
}
}
Would think this would so difficult; in fact absolutely surprised it’s not just part of Acumatica as a preference setting, but it is what it is right now.
Any help or pointers would be greatly appreciated!