Jump to content

Tyssen

Members
  • Posts

    354
  • Joined

  • Last visited

Everything posted by Tyssen

  1. I've got Tracy installed. Which tab are you seeing that error on? I'm seeing several relating to FileCompiler but they're not restricted to Admin Actions and one from Mailgun because the to parameter is incorrect.
  2. I've decided to just use a select fieldtype for choosing the pages and pass in some options so that it starts from a certain parent (using pageListSelect means showing the whole tree which is overkill). But I'm having trouble with the sending of emails. This is what I have so far: <?php class EmailBatcherCoordinator extends ProcessAdminActions { protected function defineOptions() { $pagesOptions = array(); foreach($this->wire('pages')->get(3767)->children() as $age) $pagesOptions[$age->id] = $age->name; return array( array( 'name' => 'from', 'label' => 'Who is sending', 'description' => '', 'notes' => '', 'type' => 'email', 'type' => 'select', 'options' => array( 'user1@email.com'=>'User 1', 'user2@email.com'=>'User 2', ), ), array( 'name' => 'pages', 'label' => 'Pages', 'description' => 'Select the parent of pages that contain the recipients\' email addresses.', 'notes' => '', 'type' => 'select', 'options' => $pagesOptions, 'columnWidth' => 50, ), // All the other options are the same ); } protected function executeAction($options) { if($options['testAddress']) $testAddress = $options['testAddress']; $recipients = $this->wire('pages')->find($options['pages'])->children(); $emailField = $options['email']; print_r($recipients); $i = 1; foreach($recipients as $recipient) { if(isset($testAddress)) { // if a test email, then only send first match from selected Pages or Users Roles if(isset($testAddress) && $i > 1) break; $toEmail = $testAddress; } else { $toEmail = isset($emailField) ? $recipient->$emailField : $recipient; } print_r($toEmail); //replace curly braces codes with matching PW field names $htmlBody = $options['body']; $htmlBody = $this->parseBody($htmlBody, $options['fromEmail'], $recipient); $sent = $this->sendNewUserEmail($toEmail, $options['from'], $options['from'], $options['subject'], $htmlBody); if($sent) { $this->successMessage = $i . ' email successfully sent.'; } else { $this->failureMessage = 'Sorry, no emails could be sent.'; } $i++; } return true; } // Everything else is the same } So essentially all I've done so far is change how the $recipients are selected and change the from values in sendNewUserEmail to come from a dropdown rather than text inputs. Everything else is the same. When I print $recipients, it shows the correct child pages but $toEmail prints as NULL and no email gets sent and the success message is The Email Batcher action was completed successfully instead of X emails sent.
  3. Turns out the module hadn't actually been updated and was still running the old version even though I ran the update from the admin, saw that the version number had changed to 2.0.5. So not sure what happened there, but it's all good now. ?
  4. That's where I'm going wrong then. I'm choosing the parent page and assuming that it was going to work in the same way as it does when using selector, i.e. selecting all the parent's children. Not sure why it shows the email field though as there is no email field attached to the parent's template. The reason I want to use pageListSelect is because even though this module is aimed at site admins, I'm hoping I can use the Batch Emailer at least for users with restricted access so that they can batch send emails to people assigned to pages that they can manage, and a pageListSelect is going to be more user-friendly for the less tech-savvy than them trying to work out what the page ID is etc.
  5. Sorry, whenever I've posted similar questions on other forums, I've always been told to not hijack threads and to start new ones.
  6. So something somewhere is not right. I'm running PW 3.0.62 with Profields Table 0.1.9 and your module 2.0.5 on a server running PHP 7. I've looked in the logs and nothing showing up there. What else should I be looking for?
  7. { "draw": { "id": 146, "type": "FieldtypeTable", "flags": 0, "name": "draw", "label": "Match schedule", "maxCols": 9, "col1sort": 1, "col2sort": 2, "col3sort": 3, "col1name": "round", "col1label": "Round", "col1type": "int2", "col1width": 10, "col2name": "date", "col2label": "Date", "col2type": "date", "col2width": 10, "col3name": "game", "col3label": "Game", "col3type": "int2", "col3width": 10, "col4name": "home", "col4label": "Home", "col4type": "text", "col4sort": 4, "col5name": "away", "col5label": "Away", "col5type": "text", "col5sort": 5, "col6name": "time", "col6label": "Time", "col6type": "datetime", "col6width": 15, "col6sort": 6, "col7name": "field", "col7label": "Field", "col7type": "text", "col7width": 10, "col7sort": 7, "col2settings": "dateInputFormat=Y-m-d\ndateOutputFormat=j M\ndatepicker=3\ndefaultToday=0\nyearRange=-10:+10", "col4settings": "textformatters=\nplaceholder=\ndefault=\nmaxLength=2048\nrows=1", "col5settings": "textformatters=\nplaceholder=\ndefault=\nmaxLength=2048\nrows=1", "col6settings": "dateInputFormat=\ntimeInputFormat=h:ia\ndateOutputFormat=\ntimeOutputFormat=h:ia\ndatepicker=\ndefaultToday=0\nyearRange=-10:+10\nplaceholder=", "col7settings": "textformatters=TextformatterEntities\nplaceholder=\ndefault=\nmaxLength=2048", "allow_overwrite": null, "col8name": "marshal", "col8label": "Marshal", "col8type": "text", "col8sort": 8, "col8settings": "textformatters=TextformatterEntities\nplaceholder=\ndefault=\nmaxLength=2048", "col9name": "second", "col9label": "Second game", "col9type": "text", "col9sort": 9, "col9settings": "textformatters=TextformatterEntities\nplaceholder=\ndefault=\nmaxLength=2048", "tags": "results", "collapsed": 0, "paginationLimit": 0, "useBigDelete": null, "col1options": "", "col1selector": "", "col2options": "", "col2selector": "", "col3options": "", "col3selector": "", "col4width": "", "col4options": "", "col4selector": "", "col5width": "", "col5options": "", "col5selector": "", "col6options": "", "col6selector": "", "col7options": "", "col7selector": "", "col8width": "", "col8options": "", "col8selector": "", "col9width": "", "col9options": "", "col9selector": "", "renameColumn": "", "orderByCols": "", "addRowLabel": "", "showIf": "", "themeColor": "", "themeBorder": "", "themeOffset": "", "columnWidth": 100, "required": "", "requiredIf": "" } } Not sure whether it's relevant, but my table has a column at the end that's not included in the CSV.
  8. I was using an older version of Profields table. I've updated to the latest and now it's creating the rows, but everything is coming out blank. Sample row looks like 1,21-Apr,1,"Team 1","Team 2","08:30","Field 1A" I've tried with the above and wrapping the first three columns in "" too.
  9. Actually creating separate action files which have hard-coded values will probably be the easiest and quickest; didn't think of that!
  10. I had this module working OK on a site at about this time last year. Not sure what's changed since then; site was already on 3.0.48, it's now at 3.0.62, but the module itself was at version 25. When I went to use it today it added rows for each row in the CSV but the columns were either blank or 0s. So I upgraded the module to 2.0.5 and now when I save the page I get The process returned no content.
  11. I want to update the Email Batcher action to use pageListSelect instead of selector. Everything seems to work fine in that when I choose my page, the email field then shows the email field attached to the template I've chosen but on submission I get "The Email Batcher action was completed successfully" and no emails sent, whereas if I use 'type' => 'selector' I get "X emails were sent successfully" and the emails are received. What else do I need to do to be able to use pageListSelect?
  12. I did a search to see if this had been requested before. If it has sorry, for double posting, but I was wondering whether it would be possible to save actions. For instance with the EmailBatcher, I might want certain fields to always be the same and not have to fill them in each time I run the action.
  13. I think the included actions pretty much cover everything I need to do already. ? One other thing we'd like to do is to solve some email deliverability issues we have. At the moment age group coordinators are just using normal email, i.e. Outlook etc and putting people's email addresses in CC or BCC fields. When you're sending to 50+ people though you can run into trouble and find that some people don't get the email. Email Batcher seems like it'd do the trick but the Pages selector lets you choose fields, subfields etc, but not an actual page selector if I wanted to choose the children of a certain page. For instance, if I have a Under 10s page which has 60 child pages which all have an email field, what would it need to look like if I were to modify EmailBatcher.action.php? And we're using WireMail Mailgun on this site. Will it hook into that or does it just use PW's default mail functions?
  14. Looking at the AdminActions module you've linked to it has a Page Manipulator action which I can use to move pages to a certain parent based on the contents of a field. So in my case, I can use the date of birth field and choose age group pages to move to.
  15. I've tested the import module and it gets the data in there OK. You have to choose a page parent to import the entries to and it only checks that parent for existing entries which means that after you've moved your pages into age groups, you can't really do a bulk update again, but you'd have to split your CSV up into different age groups and import individually into each age group parent. Unless I'm missing something?
  16. I've seen https://modules.processwire.com/modules/import-pages-csv/ which would get all the data in there to start with, but do you know if that would that work for updating or ignoring existing entries or would it overwrite everything? And on import, how would I go about assigning players to different age group pages based on their date of birth? Or would it be better to use the import module to import players into a single parent and then create another script which uses the API to copy all those pages into age group categorised pages, e.g. Uncategorised page - Player 1 - Player 2 - Player 3 Run script produces… Age 1 page - Player 1 - Player 2 Age 2 page - Player 1 - Player 2
  17. I built a website for a football club in PW a while back and am now contemplating extending it further to enable the club to manage the organisation of their junior teams. Currently, registrations are taken on another site and then XLS files are exported and then split up into different age groups and sent to each age group coordinator who then moves stuff around in Excel to create the teams and then when they're finalised, XLSs are uploaded to a shared Dropbox folder. So a bit of a clunky system. What I'd like to do with PW would be to take a single CSV exported from the registration system and be able to import it into PW as a master list of all registered players. Fields in the CSV would be name, date of birth, gender, football federation ID etc. Based on the date of birth of the player they'd then appear under the age group for each coordinator (who when they login would only be able to see players/teams related to their age group), and then the coordinators would be able to drag players around to move them into teams. So I think the page tree would look something like: Age group - Team 1 -- Player 1 -- Player 2 -- Player 3 Super admins for the system would be able to access all players and update things like whether they've paid or not (payments done offline) or whether proof of age has been sighted. They'd be able to filter on players who hadn't paid/shown proof of age, so that they could easily create a list of people to contact. As registrations happen over time, it would also be good if we could import a new CSV whenever we liked and just have it update existing entries and add new ones, rather than having to only export new entries from the registration system. I'm thinking that PW's page tree and it's ability to drag pages would handle the requirement to be able to move players between teams, but don't really know how to go from importing a CSV to splitting the players up amongst the different age groups. Do you think this is something that PW can handle? And how would I go about it?
  18. Thanks. It was the uninstalling/reinstalling the module step that I was missing. ?
  19. I managed to figure this out last year but when I've come to do it again today, something's not working, and I can't find the forum threads that originally led me to the solution. I have the Processwire general settings module installed. When you install it, it automatically gives you a menu item under the Setup menu. I want to give non superuser members access to that too. What I found before said to add a permission to the getModuleInfo function for the module. I've done that, added a permission in the control panel, and assigned it to the role but it's not showing up under Setup when I log in as that user. So I must've missed a step, but can't think what it might be.
  20. Feature request: the ability to have backups sent via email as well as saved on the server.
  21. I'm interested in this module for a particular site but for it to be most useful I'd need to get all existing files into the manager first and then update fields to use it rather than the current file/images fields. Is the module able to scan the contents of assets/files and copy them to wherever Media Manager accesses them from? Or does it do that automatically when you install it?
  22. Thanks guys! Sorry for the late reply, didn't get any notifications of replies. Going to give both methods a try.
  23. Is there any way with PW to do environment-specific robots.txt, i.e. to block robots from staging sites without having to manually edit files in different environments?
×
×
  • Create New...