-
Posts
10,902 -
Joined
-
Last visited
-
Days Won
349
Everything posted by adrian
-
[SOLVED] How to set fromName to all PW outgoing emails?
adrian replied to PWaddict's topic in General Support
This is probably the "right" way to do it: https://github.com/processwire/processwire/blob/d8945198f4a6a60dab23bd0462e8a6285369dcb9/wire/config.php#L1274-L1280 Also note that most / all WireMail modules have their own settings for this as well which is where I typically set it. -
Maybe you know this already, but that FB config won't affect AdminActions, but it does let me know that the only wiremail module you have installed is WireMailSmtp which is helpful. I think it should be being sent using it, but these days sending via SMTP is getting more and more difficult. I pretty much exclusively use services like Mailgun now. If you want better reliability from SMTP and you are using gmail for that, you might want to try Ryan's https://github.com/ryancramerdesign/WireMailGmail because it will allow you to use proper authentication to access to it, rather than needing to enable the "less secure apps" option which might be the reason you are seeing that "could not verify" message.
-
It should use it automatically - the action just makes a $mail->new() call. Ryan built a module (https://github.com/ryancramerdesign/WireMailRouter) that lets you choose which wiremail module to use, but if you only have one installed, it should be used. Does that help?
-
@bernhard - I completely agree that there is no point using AOS for just this purpose. That was my intention by saying "if you are already running" in my comment above. I know it's unmaintained, but with the features I use from it, I haven't noticed any bugs - I am sure there are likely some features that are buggy. The problem is that I really struggle to use PW without it. Just an FYI - when it was first being developed, I thought it was a crazy idea - way too hard to maintain and make stable with all those features, but it works for my needs, but I completely agree it's not something that should be recommended for one simple feature like this.
-
Or, if you are already running AdminOnSteroids, it lets you easily load js and css files in the admin.
-
@ryan - wondering if you could perhaps start providing a changelog for pro modules. I know this request might seem a bit OT here, but I am a huge fan of @netcarver's ModuleReleaseNotes module with the way it integrates into the module update process. It shows the git commits and the contents on a CHANGELOG file if it exists. I know that because these aren't hosted on publicly accessible repos, this might be difficult, but it would be really helpful because I always like to review what has changed about a module before updating in case it looks like there might be something that needs testing and also just to know what new features I should look out for.
-
@ryan - just an FYI that the Events module directory entry has a forum/support button, but it has no link so it's a bit confusing. Not sure if this is an indication of a bug in the module's directory in general, or is somehow specific to this module.
-
@robert - easily fixed by removing the PHP closing tag at the end of your module file. It's best practice to leave this off to prevent scripts unintentionally outputting content.
-
@benbyf - I am not running any sites on it yet and I actually don't think I will until I know that Ryan has 8 installed on his dev machine. He still seems to be in "new feature mode" rather than "bug fix mode" at the moment so I can see some of these PHP 8 bugs lingering for a while. I am still running 8 on my local dev machine but these days this is mostly for module development and not much else, so I am not coming across these other bugs yet.
-
The old version of @Robin S's HannaCodeDialog module also called that method: https://github.com/Toutouwai/HannaCodeDialog/blob/7ea31c31f151fbe3ea1982c83ac94dfa209e763e/HannaCodeDialog.module#L175 Update to the latest version of that and you should be fine.
-
Hi @robert - thanks very much for your work on this. I few initial observations for you ? 1) I think it would be useful if it worked in the admin (ie change the autoload to allow this) because Tracy's Console panel sets $page to the object of the page being edited. 2) If you are running recent versions of PHP, you get an error on line 180. A simple fix is to replace count with wireCount 3) On line 185 you need to replace get_class($val) with is_object($val) && get_class($val) to prevent a "on bool" type error. Again, probable related to recent PHP versions. 4) I am not yet sure what extra info this provides over the Page Field List & Values section of Tracy's RequestInfo panel. Is it just a formatting preference or is it the support for fields like Mystique - not sure if Tracy would handle this properly or not - never tried it. Thanks again!
-
Glad you got it sorted - if it's not already, I think this should be posted as an issue on Github. We desperately need to start culling these weird inconsistencies that waste hours of time and make you go grey ?
-
@digitex - that interface is simply "Adminer" which I include as part of Tracy. Of course you can view this via PHPMyAdmin or a desktop client like SequelAce. But it sounds like it's no use to you anyway. Hope you can dig in further and figure out what the problem might be.
-
-
Because it's the only reliable way to parse HTML properly and it is much easier to query and replace things - I just wish it didn't mess with the html when saving. Some people say to use saveXML() but that has other problems. The new line issue is easily fixed with a trim(). As for the self closing tags and the slash - I guess that doesn't bother me too much. This shouldn't be so hard ?
-
Just tested now and unfortunately it's logging me out again. I tried moving things to __destruct and removing the session_write_close but that just resulted in the timeout issue ?
-
Good point @horst about using getallheaders() to ensure the fingerprint matches. I have combined that with @Robin S's code and it looks like we have a winner. Your combined brilliance seems to have got us through. I'll test a bit more tomorrow, including on a production server with https, but hopefully we'll be good. Here is the version I am using: // make URLs in links panel root relative and get titles if not supplied $existingConfig = $this->wire('modules')->getModuleConfigData($this); $existingLinks = isset($existingConfig['linksCode']) ? $existingConfig['linksCode'] : ''; $savedLinks = isset($data['linksCode']) ? $data['linksCode'] : ''; if($savedLinks !== $existingLinks) { $this->addHookAfter('ProcessWire::finished', null, function($event) { // Make URLs in links panel root relative and get titles if not supplied $tracyConfig = $this->wire('modules')->getModuleConfigData($this); // Close existing session to avoid session blocking $allHeaders = getallheaders(); session_write_close(); $allLinks = array(); $http = new WireHttp(); foreach($allHeaders as $header => $value) { if('Host' == $header) continue; $http->setHeader($header, $value); } foreach(explode("\n", $tracyConfig['linksCode']) as $link) { $link_parts = explode('|', $link); $url = trim($link_parts[0]); $title = isset($link_parts[1]) ? trim($link_parts[1]) : ''; $url = str_replace($this->wire('config')->urls->httpRoot, '/', $url); if($title == '') { $fullUrl = strpos($url, 'http') === false ? $this->wire('config')->urls->httpRoot . $url : $url; $html = $http->get($fullUrl); libxml_use_internal_errors(true); $dom = new \DOMDocument(); $dom->loadHTML($html); $list = $dom->getElementsByTagName('title'); libxml_use_internal_errors(false); $title = $list->length ? str_replace('|', ':', $list->item(0)->textContent) : $url; } $finalLink = $url . ' | ' . $title; $allLinks[] = $finalLink; } $tracyConfig['linksCode'] = implode("\n", $allLinks); // Calling saveModuleConfigData with underscores because we don't need hooks to run again $this->wire('modules')->___saveModuleConfigData($this, $tracyConfig); }); }
-
Thank very much for figuring out the issue @Robin S - I have tried implementing your code but I keep getting logged out due to the session_write_close() and nothing happens after that. I tried testing with and without SessionHandlerDB and that made no difference. I tried to use $session->forceLogin() to log back in again after the curl request, but that didn't help either. Are you testing this on Windows? I wonder if that might be the difference?
-
Thanks for looking into improving the autodesc - much appreciated. Interesting - I haven't changed the default MySQL settings, so not sure what has changed there. The reason I am using it is that if I change to %= then a search for "stream banks" won't find instances of "streambanks" which I think is pretty important - sometimes it's hard to know whether these sorts of things are one word or two. Fair enough - I am not too worried about this at all - it's just what I thought made sense when I built that example 18 years ago, which BTW was still in production until a couple of weeks ago ?
-
@cb2004 - unfortunately Soma has left the building, but I still use that MarkupSocialShareButtons module and it works well. There is also this module (https://processwire.com/modules/video-or-social-post-embed/) which I haven't used - just in case you haven't seen it.
-
-
Oh sorry, I honestly haven't tried your module yet - probably should before I provide poor advice. In my experience there isn't a way to do this by relying on the same page IDs but maybe it's OK with the way you have things set up. I'll shut up for now ?
-
If you look at the code in Migrator you'll see that I store images in the migration zip package under a path that matches the path of the page they are associated with, so for example, an image asociated with a blog post might look something like this: Page path: /blog/my-latest-blog/ Images for that pos: zippackage/blog/my-latest-blog/image-1.jpg, zippackage/blog/my-latest-blog/image-2.jpg, etc Then when the migration package is installed on the other site and the new page ID for blog/my-latest-blog/ is determined, the images are then added to that page and installed into the /assets/files/xxxx that matches that new ID. There is so much to consider with all this stuff, but if you run through a full migration of a tree of pages using Migrator you'll see how it stores all this stuff in the zip and how it modifies the paths in RTE fields to match the path of the page and then back to the /assets/files path again.
-
@MarkE - also, just a reminder about updating the path to images embedded in RTE fields. You might find some useful code for that starting here: https://github.com/adrianbj/ProcessMigrator/blob/b327626606bcdc9cc6c74bd00f9e9d2bcd2cae50/ProcessMigrator.module#L2588