Skip to content

Instantly share code, notes, and snippets.

@rgranadino
Created November 3, 2013 20:08
Show Gist options
  • Save rgranadino/7294237 to your computer and use it in GitHub Desktop.
Save rgranadino/7294237 to your computer and use it in GitHub Desktop.
<?php
class Email {
//...
public function setAttachments(array $files) {
$this->attachment_list = array();
foreach($files as $filename => $file) {
if (is_str($filename)) {
$this->addAttachment($file, $filename);
} else {
$this->addAttachment($file);
}
}
return $this;
}
//...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment