Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 01/27/2026 in all areas

  1. Hi ProcessWire community! πŸ‘‹ I'm excited to share a new module I've been working on: TeleWire - a Telegram notifications module that brings instant messaging capabilities to your ProcessWire sites. The Problem with Current Notification Solutions After running several e-commerce sites and experimenting with different notification systems, I've encountered these recurring issues: πŸ“§ Email (SMTP/WireMail): Requires SMTP server configuration (WireMailSMTP) Google App Passwords setup complexity Emails constantly landing in spam folders Delayed delivery (sometimes 5-10 minutes) No guarantee the recipient will see it quickly πŸ“± SMS (Twilio, etc): Monthly fees just to keep a phone number active (~$1-15/month) Per-message charges (can add up quickly) US compliance requirements (verification, regulations) Not everyone wants to share their phone number πŸ’¬ WhatsApp Business API: Requires business verification Complex setup process API fees and restrictions Limited to business accounts πŸ”” Push services (Pushover, etc): Requires purchasing apps ($5-10 per platform) Recipient needs to install and configure the app Additional barrier to entry Why Telegram? πŸ†“ Completely free - No monthly fees, no per-message charges, no app purchases 🌍 Widely available - Free to download on any platform, 900+ million users worldwide ⚑ Instant delivery - Messages arrive in 1-2 seconds, not minutes 🎯 Low barrier to entry - Just "install the free app and start a chat with the bot" vs "pay $5" or "give me your phone number" πŸ”’ Reliable - No spam filters, no deliverability issues, no carrier restrictions πŸ“± Multi-platform - iOS, Android, Web, Desktop - works everywhere 🎨 Rich features - HTML formatting, emojis, photos, documents, links Key Features πŸš€ Send text notifications with HTML/Markdown formatting πŸ“Έ Send photos and documents πŸ‘₯ Support for multiple recipients (users and groups) πŸ”§ Simple admin interface with test button πŸ“Š Optional logging and debug mode ⚑ Optimized performance with configurable timeouts 🎯 Easy to integrate with hooks Real-World Use Cases E-commerce order notifications: $wire->addHookAfter('FormBuilderProcessor::processInputDone', function($event) { $form = $event->object; if($form->name === 'order-form') { $telewire = $this->modules->get('TeleWire'); $message = 'πŸ›’ <b>New Order</b>' . "\n\n"; $message .= 'πŸ‘€ Customer: ' . $form->get('customer_name')->value . "\n"; $message .= 'πŸ’° Total: $' . $form->get('total')->value; $telewire->send($message); } }); Failed login attempts monitoring: $wire->addHookAfter('Session::loginFailed', function($event) { $telewire = $this->modules->get('TeleWire'); $name = $event->arguments(0); $message = '⚠️ <b>Failed Login Attempt</b>' . "\n\n"; $message .= 'Username: ' . $name . "\n"; $message .= 'IP: ' . $this->session->getIP(); $telewire->send($message); }); Content updates: $wire->addHookAfter('Pages::saved', function($event) { $page = $event->arguments(0); if($page->template == 'article' && !$page->isNew()) { $telewire = $this->modules->get('TeleWire'); $message = 'πŸ“ <b>Article Updated</b>' . "\n"; $message .= 'Title: ' . $page->title . "\n"; $message .= 'By: ' . $this->user->name; $telewire->send($message); } }); Send photos with captions: $telewire = $modules->get('TeleWire'); // Product photo when new product added $telewire->sendPhoto( $page->images->first()->httpUrl, "New product: {$page->title} - \${$page->price}" ); Send documents (invoices, reports): $telewire = $modules->get('TeleWire'); // Send generated PDF invoice $telewire->sendDocument( '/site/assets/invoices/invoice-123.pdf', 'Invoice #123 for Order #456' ); Installation Get a bot token from @BotFather on Telegram (takes 30 seconds) Install the module from GitHub Configure your bot token and chat IDs Click "Send Test Message" to verify everything works Requirements: PHP 8.2+ and ProcessWire 3.0.210+ Admin Interface Features The configuration page includes: βœ… Real-time connection status indicator πŸ§ͺ One-click test message button (AJAX, no page reload) βš™οΈ Configurable parse mode (HTML/Markdown/MarkdownV2) πŸ“ Optional logging with debug mode for troubleshooting ⏱️ Adjustable API timeouts πŸ”‡ Silent mode option (no notification sound) πŸ“Š Message length handling (auto-split long messages) Production Ready This module is currently running on several production sites: 🍫 E-commerce shop - order notifications, stock alerts 🍷 Wine/liquor business - order confirmations, delivery updates πŸ“° News portal - content publishing notifications Average response time: ~150-300ms per notification Getting Your Chat ID Find @userinfobot in Telegram Send any message - it will reply with your Chat ID Important: Start conversation with your bot by sending /start Enter the Chat ID in module configuration For groups: Add the bot to your group, make it admin, and use the negative Chat ID API Documentation // Get module instance $telewire = $modules->get('TeleWire'); // Simple text message $telewire->send('Hello from ProcessWire!'); // HTML formatted message $message = '<b>Bold</b> <i>italic</i> <code>code</code>'; $telewire->send($message); // Send with custom options $telewire->send('Silent notification', [ 'disable_notification' => true, 'parse_mode' => 'Markdown' ]); // Send photo $telewire->sendPhoto('/path/to/photo.jpg', 'Optional caption'); // Send document $telewire->sendDocument('/path/to/file.pdf', 'Document caption'); Feedback Welcome! I'd love to hear your thoughts, use cases, and suggestions. If you've been frustrated with email deliverability or SMS costs for notifications, give this a try! GitHub: https://github.com/mxmsmnv/TeleWire Thanks to the ProcessWire community for the inspiration and all the great modules that helped me learn the PW module system!
    2 points
  2. This works perfect. The events from the whole year are returned. $events = $pages->find("template=event-item, rockcalendar_date.inRange='2026-01-01 - 2026-12-31', sort=rockcalendar_date, parent.template=event, limit=6"); However if I specify a certain month (like december only) - the recurring events - are not included in the results. $events = $pages->find("template=event-item, rockcalendar_date.inRange='2026-12-01 - 2026-12-31', sort=rockcalendar_date, parent.template=event, limit=6"); I have the feeling this is because those recurring events had their initial start date in january. When including january in the search query they are included in the results. I created like 100 recurring events (for each event-parent) so there are more than enough event pages in the backend that should take place in december. EDIT: There seems to be something wrong when creating those recurring events in the first place. I have to investigate this: - I create an initial start event for example on january the 5th - then I create 100 recurring events - the events are shown in the page tree under the event-parent page - on the rockcalendar_calendar field on the event-parent page I see the recurring events only for january. if i switch a few months into the future no recurring event of this series that I just created is visible EDIT 2: I installed an older version of this module (1.5.1) that I am using in a different project. The error is not happening here. All recurring events are shown in the calendar on the event parent and also the query selector is working (if december only is selected). I switched back to the current version (2.0.0) and the error is back. This is no deal breaker as I can use the older version instead but I just want to let you know.
    1 point
  3. Hi everyone, This module completely replaces the default ProcessWire image sizing engine with the powerful Intervention Image v3 library. The goal was to modernize how we handle images in ProcessWire, bringing in features like AVIF support, superior resizing quality, and strict aspect-ratio handling, while keeping the API compatible with what you already know. πŸš€ What does it do? Replacement: It hooks into Pageimage. You can keep using $image->width(300), $image->size(800, 600), or $image->crop(...) just like you always have. Modern Formats: Automatically handles WebP and AVIF generation. Smart Responsive Images: It introduces a configuration-based approach where you define Breakpoints, Grid Columns, and Resizing Factors. The module uses these settings to automatically calculate and generate the perfect srcset for your layouts. ✨ New Methods: render() and attrs() While standard methods work as expected, I’ve added/updated methods to handle modern HTML output: 1. $image->render(string $preset, array $options) This outputs the complete HTML tag. It automatically handles: The <img> tag with srcset and sizes. The <picture> tag with <source> elements if you have enabled extra formats (like AVIF/WebP) in the settings. Lazy Loading & LQIP: It automatically generates a Low Quality Image Placeholder (pixelated/blur effect) and applies a base64 background to the image tag for a smooth loading experience. // Example: Render a 'landscape' preset defined in module settings echo $page->image->render('landscape', ['class' => 'my-image']); 2. $image->attrs(string $preset, array $options) Perfect for developers who use template engines like Twig or Latte, or prefer full control over their HTML. This returns an array of attributes instead of an HTML string. $data = $page->image->attrs('landscape'); // Returns array like: // [ // 'src' => '...', // 'width' => 1200, // 'height' => 675, // 'srcset' => '...', // 'sources' => [ ... ], // Array for picture tag sources // 'style' => 'background-image: url(data:image...);', // LQIP Base64 // 'class' => 'iv-lazy ...' // ] βš™οΈ Configuration Strategy Instead of hardcoding sizes in your templates, you configure your design tokens in the module settings: Breakpoints (e.g., 1200px) Aspect Ratios (e.g., 16:9) Grid Columns (e.g., 1-1, 1-2, 1-3) Factors (e.g., 0.5, 1, 1.5, 2 for Retina support) The module calculates the necessary image dimensions based on these combinations. If you request a specific aspect ratio, it ensures strict adherence to it, preventing 1px rounding errors. πŸ“ A Note on Documentation I wanted to get this into your hands as soon as possible, but due to a heavy workload, I haven't finished writing the detailed README.md yet. Currently, you can grab the code from GitHub (link below). I will submit this to the official ProcessWire Modules Directory after add some other features and after update readme.md Download / GitHub: GitHub Repo I’d love to hear your feedback and suggestions!
    1 point
Γ—
Γ—
  • Create New...