Public Mail API in CPM
I am trying to fetch an Incident attachment and send it as an email to an external customer(mimicing the behaviour of Forward Incident info).
But I find that neither file_get_contents or getAdminURL seems to work. Is there any other way to fetch Incident attachment in CPM?
I have tried following code:
$inc_file_atachments = $obj->FileAttachments;
foreach($inc_file_atachments as $each_inc_file_atachments)
$fattach = new RNCPHP\FileAttachmentCommon();
$fattach->ContentType = $each_inc_file_atachments->ContentType;
$fp = $fattach->makeFile();
$filecontent = file_get_contents($each_inc_file_atachments->URL);