Page 1 of 1

EasySwift and the default encoding

Posted: Mon Feb 18, 2008 8:06 am
by andr3a
Hi there,

first of all thank you for Swift Mailer, it seems to be a good project, really.

I am here just to report a bug in last release, exactely in file EasySwift and line 739.

Since 3 lines before you wrote
* @param string The encoding used (default is base64)

I think you should change the default null value from parameter $encoding and method addAttachment.

It is just because if someone is using this great wrapper for old Swift version and he doesn't add base64 encoding this wrapper will send a new Swift_Message_Attachment($data, $filename, $type, $encoding), with null value.

I am not sure the problem I had with PDF was there, anyway this is just a little doc or code problem that you could easily solve, changing the comment or using $encoding="base64" as default, as is in Swift_Message_Attachment constructor.

Cheers,
Andrea Giammarchi

Re: EasySwift and the default encoding

Posted: Mon Feb 18, 2008 8:38 am
by andr3a
I would like tell you that I solved EasySwift attachment problems sending manually base64, as last encoding parameter.

This is just to confirm that you can easily fix this little bug changing EasySwift file, in line 739, this method declaration:

Code: Select all

public function addAttachment($data, $filename=null, $type="application/octet-stream", $encoding=null)
with this one

Code: Select all

public function addAttachment($data, $filename=null, $type="application/octet-stream", $encoding='base64')
Kind Regards

Re: EasySwift and the default encoding

Posted: Mon Feb 18, 2008 6:06 pm
by Chris Corbyn
Eek! I didn't even realise that class was still there. I should have deprecated this ages ago ;) Surprised it even still works at all :P

Re: EasySwift and the default encoding

Posted: Tue Feb 19, 2008 7:29 am
by andr3a
Its only a Wrapper, but it is working perfectly.
So please do not remove them from your next release :D

Cheers,
Andrea

Re: EasySwift and the default encoding

Posted: Tue Feb 19, 2008 2:38 pm
by Chris Corbyn
andr3a wrote:Its only a Wrapper, but it is working perfectly.
So please do not remove them from your next release :D

Cheers,
Andrea
I'm afraid it will definitely be gone in next release. EasySwift is a v2 wrapper. Th next release is going to be v4 and I simply can't maintain something two versions old ;)