Download the PHP package archey347/uf_mailattachments without Composer
On this page you can find all versions of the php package archey347/uf_mailattachments. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download archey347/uf_mailattachments
More information about archey347/uf_mailattachments
Files in archey347/uf_mailattachments
Package uf_mailattachments
Short Description This sprinkle adds support for mail attachments in UF
License MIT
Homepage https://github.com/archey347/UF_EmailAttachments
Informations about the package uf_mailattachments
UF_MailAttachments
This sprinkle adds support for mail attachments to UserFrosting
Deprecation Notice for v2
Due to some weird PHP reasons, it can't seem to accept paremter types that are children of paremeter types of the parent class' method definition. I'm not sure what PHP version this became a problem in. I don't know if it's just something that I've done wrong, but for some reason the zend compiler barfs at it. As a cheap fix, for v2 of this sprinkle, you now have to call the sendWithAttachments
or sendDistinctWithAttachments
instead rather than the normal functions. I'll probably try and get it implemented in UF's mailer directly rather than having an extension.
Usage
Usage is similar, you just need to use differenct classes and a different service.
First, create a message
Usage of the ExtendenTwigMailMessage
is the same as the standard TwigMailMessage
To add an atachment, create a MailAttachment
Object
To send the message use the extendedMailer
service
Options
The attachment object has four options which can be set in the constructor.
$file
- The contents of the file$fileName
- The name of the file$encoding
- How the file should be encoded (defaults toPHPMailer::ENCODING_BASE64
)$mimeType
- The mime type of the file (if left blank, PHPMailer will automatically detect the mime type)