Jump to content

adrian

PW-Moderators
  • Posts

    11,150
  • Joined

  • Last visited

  • Days Won

    368

Everything posted by adrian

  1. @nabo - I just did some cleanup of that code and was actually also needing to link URLs, so I just use this: $text = preg_replace('/(<td>)(http(.*?))(<\/td>)/', '$1<a href="$2">$2</a>$4', $text); which is obviously much cleaner than the preg_match_all approach - I think I must have been in a rush last time and not thinking properly ?
  2. Just a quick thought until I have more time to test. Because I don't have the "name" of the recipients, I am setting up $to in a loop like this: $to[] = $u->email; instead of: $to['email'] = 'My Name'; Do you think that having a numeric instead of associative array could be a problem?
  3. Sorry @nbcommunication - in the middle of some other things at the moment. I actually ended up setting the "to" array because we had a newsletter going out this morning, so I will need to go back to dev setup to test without it. I'll take a look later and get back to you. I do have another question for you though. When sending, the returned value is the number of emails sent, which for this module is the returned value of the apiRequest() method. The weird thing is that in my testing with a few recipients, the count was always correct, but my client sent our first proper mailout today and she said it reported more than the number of people that we have in our list. It's only a list of 130 users at the moment, but it returned 154. Have you seen anything like this before? Do you think this is something I should ask via MailGun support? Thanks.
  4. That actually is correct - the email field for some recipient groups is "email", but for others it's "title" - $email is defined further up. Sorry for the confusion though ?
  5. @webcraft - as of today, 3.0.148 is the new master version (https://processwire.com/download/core/) so please use that and you shouldn't have anymore PHP 7.4 issues.
  6. There's more than one way to skin a cat. Anyway the current version fixes it as well, just in a different way.
  7. There are several Windows users who have it working, including @bernhard - there are posts above that detail a few different ways of getting it to work and also some more info on the docs site - I'm honestly not sure what is best.
  8. Sorry about that @dragan - should be fixed in the version just committed. PS - glad you're enjoying Module Toolkit ?
  9. Just in case you haven't come across this site before: https://caniuse.com/#search=webp
  10. Thanks for the update @alexmercenary - be sure to also load up the Template Path panel when using the dev template option - it is a handy way to view what's being replaced on various pages/templates and I fixed a couple of issues with the "tracy-all-*" approach the other day so definitely worth looking at now.
  11. Sorry, I can't seem to duplicate that issue at the moment. I am testing with tracy-all-dev permission with no existing tracy-home-dev permission and looking at the home page and it's showing the home-dev.php template. Maybe you can give me access to the new site to take another look?
  12. @alexmercenary - is it an issue with tracy-all-dev permission again? I did actually make some other changes to that functionality 11 days ago - perhaps I broke something again - sorry if that's the case. Can you please confirm that is the problem you are referring to at the moment?
  13. @gebeer's awesome https://processwire.com/talk/topic/22665-module-imagereference-pick-images-from-various-sources/ is compatible with Settings Factory.
  14. SettingsFactory is awesome - I use it on almost all sites now!
  15. @matjazp - do those messages actually show for non-superusers? I wouldn't be surprised if they did but I don't think they should - to me this is maybe a bug? That said, what about something like this in Tracy's Console panel? foreach($modules as $m) { if($modules->isInstalled($m)) { $modules->get($m); } } Untested, but I think it might work.
  16. @nbcommunication - I am getting this error: "Code 400: The parameters passed to the API were invalid - 'to' parameter is not a valid address. please check documentation" when using the addRecipientVariables without also defining the `to` array. Here is my code: $recipientsArr = array(); foreach($recipients as $u) { $recipientsArr[$u->$email] = array( 'id' => $u->id, 'email' => $u->$email ); } $mailer = $mail->new(); $mailer->setBatchMode(true); $mailer->addRecipientVariables($recipientsArr); Everything seems to be working ok, but it would be nice is that error wasn't being logged. Any ideas? Thanks.
  17. Why not use the dev version of PW instead? It's going to be released as the new stable/master version probably within the next week anyway. Would save you the effort of going back to 7.3.
  18. Screenshot is from the Image Picker of a CkEditor field. Here is the collapsed state? It lets you select images from any other page in the tree. While I agree that it's confusing that the option is collapsed and so not obvious, I still don't understand how your version would provide different functionality. Maybe you should just create it - clearly I am just missing something still - sorry ?
  19. I know I am being dumb and missing something, but I can choose images from any page in the tree. Where is the setting you're talking about?
  20. @gebeer - seems like there is an issue with the outline/border around the page selectors when expanded. It would be nice if that bottom border was still present to keep the pages separate. Thanks!
  21. I feel like this should be a good idea, but at the moment I am not quite understanding how it will improve the current interface because it already shows thumbnails of images on the selected "other" page. Could you maybe describe in more detail please?
  22. Hi everyone. I've just committed v2.0.0 of this module with some BREAKING CHANGES. The breaking change is the removal of the "Enable for API" option. After lots of discussion and testing with @Robin S's help we decided that it's best that this module doesn't handle renaming via the API - it's not really its intended purpose, but there are also too many complications when it comes to dealing with hooks that save pages. This has allowed me to simplify the module significantly as well as now all the renaming is done via JS which is more inline with how the PW core sets the page name when you initially title a page. This update also adds individual Exempt Roles settings for each of relevant settings, rather than the old overarching option. I have also done quite a bit of cleanup and refactoring, but all those should be taken of via the module's upgrade() method. That said, I still recommend taking a good look over the settings page to make sure it's still showing what you expect and that the module's behavior is still correct for your needs. Please let me know if you find any problems. Happy Holidays all!
  23. This is an example of something I do with Profields Table for replacing Twilio message and error codes with links to the entry in the logs on the Twilio site. You should be able to adapt to your needs. // link SID and error code columns in User message tables to the Twilio log entry $this->wire()->addHookAfter('InputfieldTable::render', function($event) { if(!in_array($event->object->name, array('received_messages', 'incoming_messages', 'queued_messages', 'undelivered_messages', 'failed_messages'))) return; $text = $event->return; if(preg_match_all("/<td>(S|M)M(.*?)<\/td>/", $text, $matches)) { foreach($matches[0] as $match) { $sid = str_replace(array('<td>', '</td>'), '', $match); $text = str_replace($match, '<td><a href="https://www.twilio.com/console/sms/logs/'.$sid.'">'.$sid.'</a></td>', $text); } } if(preg_match_all("/<td>([0-9]{1,})<\/td>/", $text, $matches)) { foreach($matches[0] as $match) { $errCode = str_replace(array('<td>', '</td>'), '', $match); $text = str_replace($match, '<td><a href="https://www.twilio.com/docs/api/errors/'.$errCode.'">'.$errCode.'</a></td>', $text); } } $event->return = $text; });
  24. Hi @tires - I'm sorry, it still works fine here. I just tested with: https://www.youtube.com/watch?v=aqz-KE-bpKQ Any chance you can give me access to the site to take a look?
  25. All my fault - it actually was an issue with those checks on the line you pointed out. The difference on my test site was that even though I didn't have the tracy-home-dev permission checked, it was created so the conditional was returning true. On your site that permission didn't exist so it wasn't proceeding. The first check now also checks for the "all" version of that permission before checking if the current user has it.
×
×
  • Create New...