A client of ours has a huge magento product database and they requested the ability to do mass updates to those products. At first we decided to have them use the Import/Export section of the site but because of the size of the product database it wasn’t possible. Then we decided to use the profile system in a cron but, considering all of the products in the database are configurable, and the profile system ignores configurable products that wouldn’t work either. So we landed on pulling the Import/Export system into a nightly cron.
and here it is
https://github.com/paulmeta13/magento-cron-importexport
I copied the content from the site above to ensure we don’t loose it.
AOL Mail
1. Click Contacts in the right toolbar.
2. Click Add Contact.
3. Enter [wlemail] and additional information if you wish.
4. Click Add Contact button in the popup to finish.
Comcast
1. Click Preferences from the menu.
2. Click Restrict Incoming Email.
3. Click Yes to Enable Email Controls.
4. Click Allow email from addresses listed below.
5. Enter [wlemail] you want to whitelist.
6. Click Add.
7. Click Update to finish.
Earthlink
1. Click Address Book.
2. Click Add Contact.
4. Save WhatCounts as a contact.
5. Click save.
Gmail
1. Open an email from the sender that you want to whitelist.
2. Click on the little down-pointing-triangle-arrow next to “reply.”
3. Click Add [wlemail] to contacts list to finish.
Mobile.me
1. Click [wlemail] in the header of the message you’re viewing.
2. Click Add to finish.
NetZero
1. Click the Address Book tab on the top menu bar.
2. Click Contacts.
3. Click Add Contact.
4. Enter [wlemail] and additional information if you wish.
5. Click Save to finish.
Yahoo! Mail
1. Open the email message from the sender you want to add to your address book.
2. Click Add to contacts next to [wlemail].
3. On the Add Contact popup, add additional information if needed.
4. Click Save to finish.
Windows Live Hotmail
1. Open an email from the sender that you want to whitelist.
2. Click Add to contacts next to [wlemail] to finish.
Microsoft Outlook 2003
1. Open the email message from the sender you want to add to your address book.
2. Right-click Click here to download images in the gray bar at the top of the message.
3. Click Add Sender to Senders Safe List to finish.
Outlook 2007
1. Right-click on the email you received (in the list of emails).
2. Click Junk E-mail.
3. Click Add Sender to Safe Senders List to finish.
Outlook 2010
1. Click the Home tab.
2. Click Junk.
3. Click Junk E-mail Options.
4. Click Safe Senders.
5. Click Add.
6. Enter [wlemail] and additional information if you wish.
7. Click OK to finish.
Mac Mail
1. Click Address Book .
2. Click File.
3. Click New Card.
4. Enter [wlemail] and additional information if you wish. .
5. Click Edit to finish
Mozilla Thunderbird for PC
1. Click Address Book.
2. Make sure Personal Address Book is highlighted.
3. Click New Card. This will launch a New Card window that has 3 tabs: Contact, Address & Other.
4. Under Contact, enter [wlemail] and additional information if you wish.
5. Click OK to finish
Mozilla Thunderbird for Mac
1. Click Address Book.
2. Make sure Personal Address Book is highlighted.
3. Click New Card. This will launch a New Card window that has 3 tabs: Contact, Address & Other.
4. Under Contact, enter [wlemail] and additional information if you wish.
5. Click OK to finish
If you have a really large csv you might have a big DB query before it that will take some time. The browser will have to sit there and wait for data to come in before it sends the headers and tells the browser to start downloading which can sometimes timeout. to fix this place the code below right under your headers and before you data processing.
ob_implicit_flush(true); ob_end_flush();
If you have a file input field on a C5 form and you want it to send those files in the notify email
First open concrete/helpers/mail.php it should look like this
defined('C5_EXECUTE') or die("Access Denied."); class MailHelper extends Concrete5_Helper_Mail { }
Make it look like this
defined('C5_EXECUTE') or die("Access Denied."); class MailHelper extends Concrete5_Helper_Mail { protected $files = array(); /** * Add an attachement to the email by the file id * @param int $fileId */ public function AddAttachmentById($fileId) { Loader::model('file'); $this->files[] = File::getByID($fileId); } /** * Add an attachment to the email * @param File $file */ public function addAttachment($file) { $this->files[] = $file; } /** * Sends the email * @return void */ public function sendMail($resetData = true) { $_from[] = $this->from; $fromStr = $this->generateEmailStrings($_from); $toStr = $this->generateEmailStrings($this->to); $replyStr = $this->generateEmailStrings($this->replyto); if (ENABLE_EMAILS) { $zendMailData = self::getMailerObject(); $mail=$zendMailData['mail']; $transport=(isset($zendMailData['transport']))?$zendMailData['transport']:NULL; if (is_array($this->from) && count($this->from)) { if ($this->from[0] != '') { $from = $this->from; } } if (!isset($from)) { $from = array(EMAIL_DEFAULT_FROM_ADDRESS, EMAIL_DEFAULT_FROM_NAME); $fromStr = EMAIL_DEFAULT_FROM_ADDRESS; } // The currently included Zend library has a bug in setReplyTo that // adds the Reply-To address as a recipient of the email. We must // set the Reply-To before any header with addresses and then clear // all recipients so that a copy is not sent to the Reply-To address. if(is_array($this->replyto)) { foreach ($this->replyto as $reply) { $mail->setReplyTo($reply[0], $reply[1]); } } $mail->clearRecipients(); $mail->setFrom($from[0], $from[1]); $mail->setSubject($this->subject); foreach($this->to as $to) { $mail->addTo($to[0], $to[1]); } if(is_array($this->cc) && count($this->cc)) { foreach($this->cc as $cc) { $mail->addCc($cc[0], $cc[1]); } } if(is_array($this->bcc) && count($this->bcc)) { foreach($this->bcc as $bcc) { $mail->addBcc($bcc[0], $bcc[1]); } } $mail->setBodyText($this->body); if ($this->bodyHTML != false) { $mail->setBodyHTML($this->bodyHTML); } if (!empty($this->files)) { Loader::library('3rdparty/Zend/Mime/Part'); Loader::library('3rdparty/Zend/Mime'); foreach ($this->files as $file) { $part = new Zend_Mime_Part(file_get_contents($file->getPath())); $part->filename = basename($file->getPath()); $part->disposition = Zend_Mime::DISPOSITION_ATTACHMENT; $part->encoding = Zend_Mime::ENCODING_BASE64; $mail->addAttachment($part); } } try { $mail->send($transport); } catch(Exception $e) { $l = new Log(LOG_TYPE_EXCEPTIONS, true, true); $l->write(t('Mail Exception Occurred. Unable to send mail: ') . $e->getMessage()); $l->write($e->getTraceAsString()); if (ENABLE_LOG_EMAILS) { $l->write(t('Template Used') . ': ' . $this->template); $l->write(t('To') . ': ' . $toStr); $l->write(t('From') . ': ' . $fromStr); if (isset($this->replyto)) { $l->write(t('Reply-To') . ': ' . $replyStr); } $l->write(t('Subject') . ': ' . $this->subject); $l->write(t('Body') . ': ' . $this->body); } $l->close(); } } // add email to log if (ENABLE_LOG_EMAILS) { $l = new Log(LOG_TYPE_EMAILS, true, true); if (ENABLE_EMAILS) { $l->write('**' . t('EMAILS ARE ENABLED. THIS EMAIL WAS SENT TO mail()') . '**'); } else { $l->write('**' . t('EMAILS ARE DISABLED. THIS EMAIL WAS LOGGED BUT NOT SENT') . '**'); } $l->write(t('Template Used') . ': ' . $this->template); $l->write(t('To') . ': ' . $toStr); $l->write(t('From') . ': ' . $fromStr); if (isset($this->replyto)) { $l->write(t('Reply-To') . ': ' . $replyStr); } $l->write(t('Subject') . ': ' . $this->subject); $l->write(t('Body') . ': ' . $this->body); $l->close(); } // clear data if applicable if ($resetData) { $this->to = array(); $this->cc = array(); $this->bcc = array(); $this->replyto = array(); $this->from = array(); $this->template = ''; $this->subject = ''; $this->body = ''; $this->bodyHTML = ''; } } }
Then Find /concrete/core/controllers/blocks/form.php. In the function action_submit_form() there is a spot that looks like
$mh = Loader::helper('mail'); $mh->to( $this->recipientEmail ); $mh->from( $formFormEmailAddress ); $mh->replyto( $replyToEmailAddress ); $mh->addParameter('formName', $this->surveyName); $mh->addParameter('questionSetId', $this->questionSetId); $mh->addParameter('questionAnswerPairs', $questionAnswerPairs); $mh->load('block_form_submission'); $mh->setSubject(t('%s Form Submission', $this->surveyName)); //echo $mh->body.'<br>'; @$mh->sendMail();
change that to
$mh = Loader::helper('mail'); $mh->to( $this->recipientEmail ); $mh->from( $formFormEmailAddress ); $mh->replyto( $replyToEmailAddress ); $mh->addParameter('formName', $this->surveyName); $mh->addParameter('questionSetId', $this->questionSetId); $mh->addParameter('questionAnswerPairs', $questionAnswerPairs); $mh->load('block_form_submission'); $mh->setSubject(t('%s Form Submission', $this->surveyName)); if (!empty($tmpFileIds)) { foreach ($tmpFileIds as $tmpFileId) { $mh->AddAttachmentById($tmpFileId); } } //echo $mh->body.'<br>'; @$mh->sendMail();
Thats it!
In order to turn off all caching on concrete 5’s RSS Feed do the following
First go to /concrete/blocks/rss_displayer/controller.php and change the following from true to false
protected $btCacheBlockRecord = false; protected $btCacheBlockOutput = false; protected $btCacheBlockOutputOnPost = false; protected $btCacheBlockOutputForRegisteredUsers = false;
This turns off all caching on the block itself.
Then go to concrete/helpers/feed.php and replace
public function load($feed) { $feed = new SimplePie($feed, DIR_FILES_CACHE,60); return $feed; }
with
public function load($feed_url) { //$feed = new SimplePie($feed, DIR_FILES_CACHE,60); $feed = new SimplePie(); $feed->enable_cache(false); $feed->set_feed_url($feed_url); $feed->init(); return $feed; }
This will disable caching on the rss feed.
Recent Comments