robguay Posted August 11, 2008 Posted August 11, 2008 Is there a contribution that always me to send an attachment with the confirmation email. Or how do I use this function to acheive it? tep_mail($order->customer['firstname'] . ' ' . $order->customer['lastname'], $order->customer['email_address'], EMAIL_TEXT_SUBJECT, $email_order, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS); Something like this var $attachment_to_be_Sent = 'docs/mypdf.pdf'; tep_mail($order->customer['firstname'] . ' ' . $order->customer['lastname'], $order->customer['email_address'], EMAIL_TEXT_SUBJECT, $email_order, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, $attachment_to_be_Sent); :blink:
FIMBLE Posted August 11, 2008 Posted August 11, 2008 There is already a contribution for this. search the contributions for PDF Nic Sometimes you're the dog and sometimes the lamp post [/url] My Contributions
robguay Posted August 11, 2008 Author Posted August 11, 2008 The only mod that I could find is a mod that will allow you to email attachments through the admin panel. I need the attachment to be sent at the end of their order process, attached to the email confirmation.
Black Jack 21 Posted August 13, 2008 Posted August 13, 2008 Hi, i've found a solution in the german forum. I use it a little bit modified. includes/languages/XXX/checkout process.php add //BOC e-mail with attachment function tep_mail_pdf_anhang($to_name, $to_email_address, $email_subject, $email_text, $from_email_name, $from_email_address, $file, $filetype) { if (SEND_EMAILS != 'true') return false; if (eregi('Content-Type:', $to_name)) return false; if (eregi('Content-Type:', $to_email_address)) return false; if (eregi('Content-Type:', $email_subject)) return false; if (eregi('Content-Type:', $email_text)) return false; if (eregi('Content-Type:', $from_email_name)) return false; if (eregi('Content-Type:', $from_email_address)) return false; if ( (strstr($to_name, "\n") != false) || (strstr($to_name, "\r") != false) ) return false; if ( (strstr($to_email_address, "\n") != false) || (strstr($to_email_address, "\r") != false) ) return false; if ( (strstr($email_subject, "\n") != false) || (strstr($email_subject, "\r") != false) ) return false; if ( (strstr($from_email_name, "\n") != false) || (strstr($from_email_name, "\r") != false) ) return false; if ( (strstr($from_email_address, "\n") != false) || (strstr($from_email_address, "\r") != false) ) return false; $message = new email(array('X-Mailer: osCommerce Mailer')); $text = strip_tags($email_text); if (EMAIL_USE_HTML == 'true') { $message->add_html($email_text, $text); } else { $message->add_text($text); } $attachment = fread(fopen($file, "r"), filesize($file)); $message->add_attachment($attachment, TEXT_NAME_OF_CONDITIONS, $filetype); // $message->add_html_image($file_content, $file); $message->build_message(); $message->send($to_name, $to_email_address, $from_email_name, $from_email_address, $email_subject); } //EOC e-mail with attachment checkout_process.php find tep_mail($order->customer['firstname'] . ' ' . $order->customer['lastname'], $order->customer['email_address'], EMAIL_TEXT_SUBJECT, $email_order, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS); replace with tep_mail_pdf_anhang($order->customer['firstname'] . ' ' . $order->customer['lastname'], $order->customer['email_address'], EMAIL_TEXT_SUBJECT, $email_order, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, DIR_WS_LANGUAGES . $language . "/" . "conditions.pdf", "application/pdf"); Drop a PDF named "conditions.pdf" to your language folder. Please comment! Black Jack 21
robguay Posted August 13, 2008 Author Posted August 13, 2008 Thank you very much. I will impliment it today. I will get back with you with the results. :D
robguay Posted August 13, 2008 Author Posted August 13, 2008 This works perfect. Again THANK YOU VERY MUCH!
lee987 Posted January 24, 2010 Posted January 24, 2010 Very useful little add on, which does work if I have 'Use MIME HTML when sending emails' set to False. If it is set to true it does not work on my install. Anyone else found this? Thanks.
Guest Posted January 4, 2011 Posted January 4, 2011 Works fine, exept that it says "TEXT_NAME_OF_CONDITIONS" in the email. I have of course tried to change it, but it will not change in the email. I have also tried to add the line: define('TEXT_NAME_OF_CONDITIONS', 'Angreskjema'); in the language file. What can i do?
Guest Posted January 4, 2011 Posted January 4, 2011 "Use MIME HTML when sending emails" does not make any difference here.
Guest Posted January 4, 2011 Posted January 4, 2011 DOH. Uploaded the wrong document. Works fine now :)
Zahoor Posted March 16, 2011 Posted March 16, 2011 I am using a contribution by name: Fancier Invoice & Packing slip. I dont know where to make necessary changes so that I can attach pdf. Could someone have a look at the contribution and guide me in right direction?
Recommended Posts
Archived
This topic is now archived and is closed to further replies.