Again this is why you should not use standalone scripts anymore. If you still do that, you need to include required scripts and make sure the relative paths are correct yourself. If you just want to send an email with your custom file, you better use Route_Action server event and make sure your template has language ID that matches your language(s) of your project (e.g. NotifyCampaignEnding.en-US.php) and is placed in the “lang” folder correctly.