<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Farshid Rezaei</title>
    <description>The latest articles on DEV Community by Farshid Rezaei (@farshid_rezaei_9ab0a01897).</description>
    <link>https://dev.to/farshid_rezaei_9ab0a01897</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1806229%2Ff05f8bf6-04b6-42fd-9a9e-6e0c56d8d061.jpg</url>
      <title>DEV Community: Farshid Rezaei</title>
      <link>https://dev.to/farshid_rezaei_9ab0a01897</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/farshid_rezaei_9ab0a01897"/>
    <language>en</language>
    <item>
      <title>How to Test Laravel Emails Locally Without Sending Real Emails</title>
      <dc:creator>Farshid Rezaei</dc:creator>
      <pubDate>Thu, 12 Nov 2026 16:25:53 +0000</pubDate>
      <link>https://dev.to/farshid_rezaei_9ab0a01897/how-to-test-laravel-emails-locally-without-sending-real-emails-oi5</link>
      <guid>https://dev.to/farshid_rezaei_9ab0a01897/how-to-test-laravel-emails-locally-without-sending-real-emails-oi5</guid>
      <description>&lt;p&gt;Sending emails from Laravel is straightforward.&lt;/p&gt;

&lt;p&gt;You configure a mail driver, provide SMTP credentials, and call the Mail API.&lt;/p&gt;

&lt;p&gt;But testing email workflows safely is a different challenge.&lt;/p&gt;

&lt;p&gt;You probably don't want a test registration email reaching a real customer. You also don't want to depend on production SMTP credentials just to inspect an HTML template.&lt;/p&gt;

&lt;p&gt;In this tutorial, we'll configure Laravel to send emails to &lt;strong&gt;NotifyTrap&lt;/strong&gt;, a local-first notification testing workbench.&lt;/p&gt;

&lt;p&gt;We'll capture an email, inspect its content, and discuss how this workflow can become part of your development and testing process.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is NotifyTrap?
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://github.com/farshidrezaei/notifytrap" rel="noopener noreferrer"&gt;NotifyTrap&lt;/a&gt; is an open-source desktop application for capturing and inspecting application notifications locally.&lt;/p&gt;

&lt;p&gt;It supports four main channels:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Email through SMTP.&lt;/li&gt;
&lt;li&gt;SMS.&lt;/li&gt;
&lt;li&gt;Push notifications.&lt;/li&gt;
&lt;li&gt;Webhooks.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For email development, NotifyTrap provides an SMTP endpoint that your Laravel application can use just like a regular SMTP server.&lt;/p&gt;

&lt;p&gt;The difference is that messages are captured locally for inspection instead of being delivered to real recipients.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Install and start NotifyTrap
&lt;/h2&gt;

&lt;p&gt;First, download the appropriate release for your operating system:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/farshidrezaei/notifytrap/releases" rel="noopener noreferrer"&gt;NotifyTrap Releases&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Follow the &lt;a href="https://farshidrezaei.github.io/notifytrap/guide/getting-started/" rel="noopener noreferrer"&gt;Getting Started guide&lt;/a&gt; to install the application and create your workspace and project.&lt;/p&gt;

&lt;p&gt;Once your project is ready, create an SMTP channel and obtain its generated credentials.&lt;/p&gt;

&lt;p&gt;NotifyTrap's local SMTP endpoint uses:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Setting&lt;/th&gt;
&lt;th&gt;Value&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Host&lt;/td&gt;
&lt;td&gt;&lt;code&gt;127.0.0.1&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Port&lt;/td&gt;
&lt;td&gt;&lt;code&gt;1025&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Username&lt;/td&gt;
&lt;td&gt;Your generated channel username&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Password&lt;/td&gt;
&lt;td&gt;Your generated channel password&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Keep the generated credentials available. We'll use them in Laravel.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Configure Laravel
&lt;/h2&gt;

&lt;p&gt;Open your Laravel application's &lt;code&gt;.env&lt;/code&gt; file.&lt;/p&gt;

&lt;p&gt;Configure the mail settings:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;MAIL_MAILER=smtp
MAIL_HOST=127.0.0.1
MAIL_PORT=1025
MAIL_USERNAME=YOUR_NOTIFYTRAP_CHANNEL_USERNAME
MAIL_PASSWORD=YOUR_NOTIFYTRAP_CHANNEL_PASSWORD
MAIL_ENCRYPTION=null
MAIL_FROM_ADDRESS="noreply@local.test"
MAIL_FROM_NAME="My Application"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Replace the username and password placeholders with the actual credentials generated for your SMTP channel in NotifyTrap.&lt;/p&gt;

&lt;p&gt;The important settings are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;MAIL_HOST&lt;/code&gt;: points Laravel to the local SMTP service.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;MAIL_PORT&lt;/code&gt;: uses NotifyTrap's SMTP port.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;MAIL_USERNAME&lt;/code&gt; and &lt;code&gt;MAIL_PASSWORD&lt;/code&gt;: authenticate against your configured channel.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;After updating the environment, clear Laravel's cached configuration:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;php artisan config:clear
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Your application should now use NotifyTrap as its SMTP destination.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Send a test email
&lt;/h2&gt;

&lt;p&gt;Let's use Laravel Tinker to send a quick test message.&lt;/p&gt;

&lt;p&gt;Run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;php artisan tinker
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then execute:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="k"&gt;use&lt;/span&gt; &lt;span class="nc"&gt;Illuminate&lt;/span&gt;\&lt;span class="nc"&gt;Support&lt;/span&gt;\&lt;span class="nc"&gt;Facades&lt;/span&gt;\&lt;span class="nc"&gt;Mail&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="nc"&gt;Mail&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;raw&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="s1"&gt;'This is a test email captured by NotifyTrap.'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$message&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nv"&gt;$message&lt;/span&gt;
            &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;to&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'developer@example.test'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;subject&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'Hello from Laravel'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The address is only a sample recipient value. NotifyTrap captures the message locally; it does not deliver it to that address.&lt;/p&gt;

&lt;p&gt;Open NotifyTrap and navigate to your email channel.&lt;/p&gt;

&lt;p&gt;You should see the captured message.&lt;/p&gt;

&lt;p&gt;That's it. Your Laravel application is using its normal SMTP workflow, but the message is being captured in your local development environment.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Inspect the captured email
&lt;/h2&gt;

&lt;p&gt;Capturing an email is only the first step.&lt;/p&gt;

&lt;p&gt;When debugging email functionality, you often need to inspect more than the subject and body.&lt;/p&gt;

&lt;p&gt;NotifyTrap provides tools for examining:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;HTML and plain-text email content.&lt;/li&gt;
&lt;li&gt;Raw MIME data.&lt;/li&gt;
&lt;li&gt;Headers.&lt;/li&gt;
&lt;li&gt;Attachments.&lt;/li&gt;
&lt;li&gt;Inline CID images.&lt;/li&gt;
&lt;li&gt;Responsive email previews.&lt;/li&gt;
&lt;li&gt;Dark email client simulations.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is particularly useful when developing:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Password reset emails.&lt;/li&gt;
&lt;li&gt;Account verification messages.&lt;/li&gt;
&lt;li&gt;Order confirmations.&lt;/li&gt;
&lt;li&gt;Transactional notifications.&lt;/li&gt;
&lt;li&gt;Marketing templates.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Instead of guessing what Laravel generated, you can inspect the actual captured message.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Test OTP and magic-link emails
&lt;/h2&gt;

&lt;p&gt;Authentication emails introduce another challenge.&lt;/p&gt;

&lt;p&gt;Imagine you're testing a passwordless login flow:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Your application generates a one-time password.&lt;/li&gt;
&lt;li&gt;Laravel sends an email.&lt;/li&gt;
&lt;li&gt;Your test needs to retrieve the OTP.&lt;/li&gt;
&lt;li&gt;The test submits the OTP to your verification endpoint.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Manually opening an inbox and copying the code is not a reliable automated testing strategy.&lt;/p&gt;

&lt;p&gt;NotifyTrap includes OTP and magic-link extraction capabilities, along with APIs that can help automate notification-related workflows.&lt;/p&gt;

&lt;p&gt;It also provides a wait API, so automation can wait for a notification instead of relying entirely on arbitrary sleep durations.&lt;/p&gt;

&lt;p&gt;Consult the &lt;a href="https://farshidrezaei.github.io/notifytrap/guide/channels-and-api/" rel="noopener noreferrer"&gt;Channels and API documentation&lt;/a&gt; for the current API routes and response formats.&lt;/p&gt;

&lt;h2&gt;
  
  
  6. Go beyond the happy path
&lt;/h2&gt;

&lt;p&gt;Email delivery is not always successful.&lt;/p&gt;

&lt;p&gt;Even if your application generates a valid message, an SMTP dependency can fail or respond slowly.&lt;/p&gt;

&lt;p&gt;Your tests should consider questions such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;What happens when the SMTP service is unavailable?&lt;/li&gt;
&lt;li&gt;Does your application retry?&lt;/li&gt;
&lt;li&gt;Does a background job fail correctly?&lt;/li&gt;
&lt;li&gt;Are failed notifications logged?&lt;/li&gt;
&lt;li&gt;Does the application recover when the dependency becomes available again?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;NotifyTrap includes SMTP and HTTP Chaos Rules to help simulate failure conditions and latency.&lt;/p&gt;

&lt;p&gt;This lets you investigate failure behavior without intentionally disrupting a real notification provider.&lt;/p&gt;

&lt;h2&gt;
  
  
  7. Automate your workflow
&lt;/h2&gt;

&lt;p&gt;NotifyTrap is not limited to its desktop interface.&lt;/p&gt;

&lt;p&gt;It also includes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A local HTTP API.&lt;/li&gt;
&lt;li&gt;A standalone &lt;code&gt;notifytrap-cli&lt;/code&gt; binary.&lt;/li&gt;
&lt;li&gt;Notification waiting and retrieval commands.&lt;/li&gt;
&lt;li&gt;OTP extraction.&lt;/li&gt;
&lt;li&gt;Export capabilities.&lt;/li&gt;
&lt;li&gt;An MCP endpoint and stdio bridge.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These features make it possible to integrate notification inspection into developer workflows and automated testing tools.&lt;/p&gt;

&lt;p&gt;For example, instead of manually checking whether a notification arrived, a test workflow can wait for a matching notification and inspect its details.&lt;/p&gt;

&lt;p&gt;Check the documentation for the exact command syntax and API contracts for your installed version.&lt;/p&gt;

&lt;h2&gt;
  
  
  A note about safety
&lt;/h2&gt;

&lt;p&gt;A local testing tool should have clear boundaries.&lt;/p&gt;

&lt;p&gt;NotifyTrap is designed to capture and inspect notifications locally, not deliver them to real recipients.&lt;/p&gt;

&lt;p&gt;Its webhook replay functionality is restricted to loopback destinations such as &lt;code&gt;127.0.0.1&lt;/code&gt;, &lt;code&gt;localhost&lt;/code&gt;, and &lt;code&gt;[::1]&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;As always, avoid putting production credentials or real customer data into development environments.&lt;/p&gt;

&lt;h2&gt;
  
  
  Final thoughts
&lt;/h2&gt;

&lt;p&gt;Testing Laravel emails should not require production SMTP credentials or a collection of unrelated tools.&lt;/p&gt;

&lt;p&gt;A local SMTP capture workflow gives you a safer way to inspect the messages your application generates.&lt;/p&gt;

&lt;p&gt;With NotifyTrap, you can start with email and expand the same local testing workflow to SMS, Push, and Webhooks.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Try it:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/farshidrezaei/notifytrap" rel="noopener noreferrer"&gt;GitHub Repository&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://farshidrezaei.github.io/notifytrap/" rel="noopener noreferrer"&gt;Documentation&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/farshidrezaei/notifytrap/releases" rel="noopener noreferrer"&gt;Latest Releases&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;NotifyTrap is open source under the MIT License.&lt;/p&gt;

&lt;p&gt;If you try this workflow, I'd love to hear how you currently test Laravel notifications and what you'd improve in a local notification testing tool.&lt;/p&gt;

</description>
      <category>laravel</category>
      <category>php</category>
      <category>testing</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>I Got Tired of Writing FFmpeg Commands, So I Built a Small Go Helper</title>
      <dc:creator>Farshid Rezaei</dc:creator>
      <pubDate>Wed, 24 Dec 2025 19:30:01 +0000</pubDate>
      <link>https://dev.to/farshid_rezaei_9ab0a01897/i-got-tired-of-writing-ffmpeg-commands-so-i-built-a-small-go-helper-ccm</link>
      <guid>https://dev.to/farshid_rezaei_9ab0a01897/i-got-tired-of-writing-ffmpeg-commands-so-i-built-a-small-go-helper-ccm</guid>
      <description>&lt;p&gt;If you’ve worked with FFmpeg beyond one-liners, you know how quickly things get messy.&lt;/p&gt;

&lt;p&gt;What starts as a reasonable command slowly turns into a fragile, unreadable blob — especially once adaptive bitrate outputs, multiple renditions, and different profiles enter the picture.&lt;/p&gt;

&lt;p&gt;While building a video pipeline in Go, I hit this wall hard. So instead of copy-pasting yet another FFmpeg command, I wrote a small helper library to bring some structure back.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Idea
&lt;/h2&gt;

&lt;p&gt;The goal wasn’t to hide FFmpeg or replace it.&lt;/p&gt;

&lt;p&gt;I wanted:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;explicit, readable command generation&lt;/li&gt;
&lt;li&gt;a way to define encoding ladders without magic&lt;/li&gt;
&lt;li&gt;something testable and maintainable in a Go codebase&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The result is a small, opinionated helper that still outputs plain FFmpeg commands — just assembled in a more predictable way.&lt;/p&gt;

&lt;h2&gt;
  
  
  What It Helps With
&lt;/h2&gt;

&lt;p&gt;Right now, the focus is on ABR workflows:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;HLS and DASH outputs using CMAF&lt;/li&gt;
&lt;li&gt;basic ladder generation based on input resolution&lt;/li&gt;
&lt;li&gt;bitrate caps and trimming redundant renditions&lt;/li&gt;
&lt;li&gt;different presets for VOD vs live use cases&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It’s intentionally narrow, but already useful in real projects.&lt;/p&gt;

&lt;h2&gt;
  
  
  What It’s Not
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Not a wrapper that hides FFmpeg&lt;/li&gt;
&lt;li&gt;Not a “perfect ladder” generator&lt;/li&gt;
&lt;li&gt;Not a one-size-fits-all solution&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If shell scripts work for you, that’s totally fine. This just fits better with how I like to structure Go services.&lt;/p&gt;

&lt;h2&gt;
  
  
  Source
&lt;/h2&gt;

&lt;p&gt;The project is open source and here if you want to take a look:&lt;br&gt;
&lt;a href="https://github.com/farshidrezaei/mosaic" rel="noopener noreferrer"&gt;https://github.com/farshidrezaei/mosaic&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I’d love feedback — especially from people who’ve wrestled with FFmpeg pipelines or ABR setups before.&lt;/p&gt;

</description>
      <category>go</category>
      <category>ffmpeg</category>
      <category>videostreaming</category>
      <category>opensource</category>
    </item>
  </channel>
</rss>
