Vinai/customer-activation

Send email with attachement

Opened this issue · 0 comments

hello i'm using your very usefull extension.
I would like to send attachement to admin when a new customer make a registration
I'm trying to modify the function _sendNotificationEmail by adding a code like this
//sending file as attachment
$attachmentFilePath = Mage::getBaseDir('media'). DS . 'contacts' . DS . $fileName;
if(file_exists($attachmentFilePath)){
$fileContents = file_get_contents($attachmentFilePath);
$attachment = $mailTemplate->getMail()->createAttachment($fileContents);
$attachment->filename = $fileName;

The email is sent but the attachement always is an empty file .
Can you give me some suggestion?
Thank you very much for your help