Last active
March 21, 2018 15:09
-
-
Save milansimek/e714735c6a50361579bf22d188210923 to your computer and use it in GitHub Desktop.
Loop through contact form submissions
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| require_once('app/Mage.php'); | |
| umask(0); | |
| Mage::app(); | |
| $submissions = Mage::getModel('plugincompany_contactforms/entry')->getCollection(); | |
| $submissions | |
| ->addFieldToFilter('form_id', 1) //example parent form id filter | |
| ->addFieldToFilter('created_at', ['gt' => '2017-10-15']) //example submission date filter | |
| ; | |
| foreach($submissions as $submission) { | |
| //set status to 'viewed' | |
| // you can see all statuses here: | |
| // Plugincompany_Contactforms_Model_Entry_Source_Status | |
| $submission->setStatus(2); | |
| $submission->save(); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment