We'd love to hear from you! Provide  feedback  to earn a badge today. Take our quick survey
You're almost there! Please answer a few more questions for access to the Applications content. Complete registration
Interested in joining? Complete your registration by providing Areas of Interest here. Register

Public Mail API in CPM

Accepted answer
16
Views
6
Comments
edited Aug 6, 2016 2:54PM in Integrations and APIs 6 comments

Content

Hi Folks,

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;
            
            if($inc_file_atachments)
            {  
                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);
                    fwrite( $fp,$filecontent);

Howdy, Stranger!

Log In

To view full details, sign in.

Register

Don't have an account? Click here to get started!