Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FileAttachments #37

Closed
jwaschkau opened this issue May 9, 2016 · 4 comments
Closed

FileAttachments #37

jwaschkau opened this issue May 9, 2016 · 4 comments

Comments

@jwaschkau
Copy link

Hi

uploadContactPhoto example is not working, because client does not have a method CreateAttachment(). I wanted to attach some files to an outgoing email. I guess it works the same as for contact photos?

@Garethp
Copy link
Owner

Garethp commented May 9, 2016

Do you have a PHP error you can paste? That example was pasted directly from a test file that worked for me.

@jwaschkau
Copy link
Author

Hey, sorry for the issue. It is working without problems. I got confused because my IDE did not show autocompletion.

@jwaschkau
Copy link
Author

Works for mail items too

$this->api->getClient()->CreateAttachment(array(
                    'ParentItemId' => $itemId->toArray(),
                    'Attachments' => array('FileAttachment' => array(
                        'Name' => $attachment->getName(),
                        'Content' => $content,
                        'ContentType' => 'text',
                        'IsContactPhoto' => false
                    ))
                ));
´´´

@Garethp
Copy link
Owner

Garethp commented May 9, 2016

No problem, I thought that might be the case. It's something I want to get around to eventually. The reason is that the ->getClient() return is a SOAP client. It's methods don't really exist, but rather implement a magic __call on the language level to pass them as SOAP functions to the server. They're undocumented because there's a hell of a lot of them and I don't know them all. At some point I want my code generator to generate all of the methods you can use, but until then IDE's won't know what you're calling

@Garethp Garethp closed this as completed May 9, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants