I want to change the attachment that is sent on an automated email by selecting the filename from a table. In simple form I want to do this.
$filename = DataObject::get_by_id("MonkeysFist","ID=1");
I know I have a couple of problems with this because even if I use
The filename is given as FileName rather than its actual value.
Any thoughts, thanks