<?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: Nikola Mitrovic</title>
    <description>The latest articles on DEV Community by Nikola Mitrovic (@nikola_mitrovic_922e2665f).</description>
    <link>https://dev.to/nikola_mitrovic_922e2665f</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%2F3395259%2Fe08340c0-33f8-4378-bf06-27110a0e1553.png</url>
      <title>DEV Community: Nikola Mitrovic</title>
      <link>https://dev.to/nikola_mitrovic_922e2665f</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/nikola_mitrovic_922e2665f"/>
    <language>en</language>
    <item>
      <title>Android stops your app at 30 SMS a minute. Here is how I paced bulk sending around it</title>
      <dc:creator>Nikola Mitrovic</dc:creator>
      <pubDate>Tue, 24 Nov 2026 16:15:02 +0000</pubDate>
      <link>https://dev.to/nikola_mitrovic_922e2665f/android-stops-your-app-at-30-sms-a-minute-here-is-how-i-paced-bulk-sending-around-it-3fn5</link>
      <guid>https://dev.to/nikola_mitrovic_922e2665f/android-stops-your-app-at-30-sms-a-minute-here-is-how-i-paced-bulk-sending-around-it-3fn5</guid>
      <description>&lt;p&gt;I run &lt;a href="https://www.simgate.app" rel="noopener noreferrer"&gt;SimGate&lt;/a&gt;, an SMS gateway where the "infrastructure" is an Android phone on your desk. You pair the phone, call an HTTP API, and the message leaves from your own SIM and your own number.&lt;/p&gt;

&lt;p&gt;For a long time the API sent one message per request. Then people started looping over it with lists of 300 customers, and I learned what happens when a phone is asked to behave like a short code. This post is what I found, and the design I ended up with for bulk sending.&lt;/p&gt;

&lt;h2&gt;
  
  
  Limit 1: Android counts your messages
&lt;/h2&gt;

&lt;p&gt;AOSP ships a class called &lt;code&gt;SmsUsageMonitor&lt;/code&gt;. It counts outgoing SMS per app over a sliding window, and the stock defaults are 30 messages per minute. Manufacturers can change the numbers.&lt;/p&gt;

&lt;p&gt;Cross the threshold and the phone shows a system dialog asking whether the app may keep sending a large number of messages. Three things make this worse than it sounds:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Nothing goes out until someone taps the dialog.&lt;/strong&gt; For a gateway phone sitting in a drawer, that means sending stops until a human walks over.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;No server can dismiss it.&lt;/strong&gt; It is a system dialog, not something your app owns.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Multipart messages count once per segment.&lt;/strong&gt; A 200-character message is two segments, so it spends two of your 30.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So "under 30 a minute" is not the real budget. If half your messages are two segments long, 20 messages already cost 30.&lt;/p&gt;

&lt;h2&gt;
  
  
  Limit 2: the carrier is watching the pattern
&lt;/h2&gt;

&lt;p&gt;A consumer SIM is sold for person-to-person traffic. The CTIA Messaging Principles describe that traffic as roughly 15 to 60 messages per minute from one number, and no more than about one per second.&lt;/p&gt;

&lt;p&gt;Carriers do not publish exact thresholds, but the patterns they act on are well known:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;sudden bursts from a quiet number&lt;/li&gt;
&lt;li&gt;identical text to a large list&lt;/li&gt;
&lt;li&gt;many recipients who have never texted the number&lt;/li&gt;
&lt;li&gt;complaints&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;When you cross the line you usually do not get an error. Messages are throttled or silently dropped, and in persistent cases the SIM is suspended.&lt;/p&gt;

&lt;h2&gt;
  
  
  Limit 3: your own quota, halfway through a list
&lt;/h2&gt;

&lt;p&gt;This one is self-inflicted. With a per-request API, a client looping over 300 numbers with 120 messages left in their plan gets 120 successes and 180 failures. Now they have a half-sent campaign and have to work out who got it.&lt;/p&gt;

&lt;h2&gt;
  
  
  The design
&lt;/h2&gt;

&lt;h3&gt;
  
  
  One message every 3 seconds, per phone
&lt;/h3&gt;

&lt;p&gt;That is 20 a minute. It sits inside the CTIA person-to-person band, and it stays under Android's trigger even when some messages are two segments long. A batch of 500 finishes in about 25 minutes, which is slow by CPaaS standards and perfectly fine for appointment reminders.&lt;/p&gt;

&lt;p&gt;It is a default, not a promise about any particular carrier. Fair-use terms differ by plan and country.&lt;/p&gt;

&lt;h3&gt;
  
  
  Only background sends wait
&lt;/h3&gt;

&lt;p&gt;My first instinct was to rate limit everything going to a phone. That would have been a mistake: an OTP or a monitoring alert would sit behind a 25-minute campaign.&lt;/p&gt;

&lt;p&gt;Instead each phone has a pacing lane, and only two senders wait for a slot in it: the bulk runner, and the flush of messages that queued up while the phone was reconnecting. Both are background work whose HTTP request was already answered with &lt;code&gt;202&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;A direct single send is never delayed. It goes to the phone immediately and only &lt;em&gt;records&lt;/em&gt; itself in the lane. That record is what makes the batch yield: each single send pushes the batch's next slot back by one interval.&lt;/p&gt;

&lt;p&gt;A simplified sketch of the idea:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="no"&gt;PACING_MS&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;3000&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;nextSlot&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nb"&gt;Map&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;number&lt;/span&gt;&lt;span class="o"&gt;&amp;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="c1"&gt;// deviceId -&amp;gt; timestamp&lt;/span&gt;

&lt;span class="c1"&gt;// Background senders (bulk runner, reconnect flush) wait for a slot.&lt;/span&gt;
&lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;waitForSlot&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;deviceId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;now&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;Date&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;now&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="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;slot&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;max&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;now&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;nextSlot&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;deviceId&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;??&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="n"&gt;nextSlot&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;set&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;deviceId&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;slot&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="no"&gt;PACING_MS&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;slot&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;now&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;sleep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;slot&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;now&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="c1"&gt;// Direct sends never wait. They only push the lane forward.&lt;/span&gt;
&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;recordDirectSend&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;deviceId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;base&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;max&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;Date&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;now&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="n"&gt;nextSlot&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;deviceId&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;??&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="n"&gt;nextSlot&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;set&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;deviceId&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;base&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="no"&gt;PACING_MS&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 combined rate stays at the pace as long as the single sends alone stay within it.&lt;/p&gt;

&lt;p&gt;The honest gap: if you loop over the single-send endpoint faster than 20 a minute, nothing protects you, and the Android dialog can still appear. I decided that was the right trade. Delaying a message a person is waiting for is worse than trusting the caller to use the bulk endpoint for lists.&lt;/p&gt;

&lt;h3&gt;
  
  
  Quota is reserved up front, all or nothing
&lt;/h3&gt;

&lt;p&gt;The bulk endpoint validates the whole list and reserves quota for all of it before anything is sent. If it does not fit, nothing is taken and the response says how much room there was:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight http"&gt;&lt;code&gt;&lt;span class="no"&gt;HTTP&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="mf"&gt;1.1&lt;/span&gt; &lt;span class="mi"&gt;403&lt;/span&gt; &lt;span class="nc"&gt;Forbidden&lt;/span&gt;

&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="s2"&gt;"error"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"Daily SMS quota exceeded: this batch needs 120 messages but only 50 remain today."&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="s2"&gt;"scope"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"daily"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="s2"&gt;"requested"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;120&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="s2"&gt;"remaining"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;50&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Unsent messages are refunded if you cancel, and so is any recipient the phone rejects.&lt;/p&gt;

&lt;h3&gt;
  
  
  A batch you poll, not a request you hold open
&lt;/h3&gt;

&lt;p&gt;A 25-minute HTTP request is not an API. The create call answers at once:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl -X POST https://api.simgate.app/v1/sms/bulk \
  -H &lt;span class="s2"&gt;"x-api-key: YOUR_API_KEY"&lt;/span&gt; \
  -H &lt;span class="s2"&gt;"Content-Type: application/json"&lt;/span&gt; \
  -d &lt;span class="s1"&gt;'{
    "deviceId": "YOUR_DEVICE_ID",
    "message": "Reminder: the clinic opens at 8 tomorrow.",
    "recipients": [
      "+14155550123",
      "+14155550124",
      { "phoneNumber": "+447700900123", "message": "Hi Sam, your slot is 8:30." }
    ]
  }'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;"success"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"batchId"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"b5c1a7e2-0d33-4a0c-9d6b-2e7f1c4a9f10"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"status"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"queued"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"total"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"duplicatesRemoved"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"pacingMs"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;3000&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"estimatedDurationMs"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;6000&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"statusUrl"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"/v1/sms/bulk/b5c1a7e2-0d33-4a0c-9d6b-2e7f1c4a9f10"&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then you poll until &lt;code&gt;terminal&lt;/code&gt; is true:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="n"&gt;time&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;requests&lt;/span&gt;

&lt;span class="no"&gt;API&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"https://api.simgate.app/v1"&lt;/span&gt;
&lt;span class="no"&gt;HEADERS&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="s2"&gt;"x-api-key"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"YOUR_API_KEY"&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="n"&gt;batch&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;requests&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;post&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="s2"&gt;"{API}/sms/bulk"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;headers&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="no"&gt;HEADERS&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;json&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="s2"&gt;"deviceId"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"YOUR_DEVICE_ID"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="s2"&gt;"message"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"Reminder: the clinic opens at 8 tomorrow."&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="s2"&gt;"recipients"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"+14155550123"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"+14155550124"&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;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="kc"&gt;True&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;status&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;requests&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="s2"&gt;"{API}/sms/bulk/{batch['batchId']}"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;headers&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="no"&gt;HEADERS&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;status&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"progress"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"done"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"of"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;status&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"total"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;status&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"status"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;status&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"terminal"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;break&lt;/span&gt;
    &lt;span class="n"&gt;time&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;sleep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;failed&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="n"&gt;status&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"items"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"status"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"failed"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"expired"&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;h3&gt;
  
  
  Phones go offline, so batches pause
&lt;/h3&gt;

&lt;p&gt;A phone is not a server. It loses Wi-Fi, it gets rebooted, Android puts the app to sleep. If the phone drops mid-batch, the batch moves to &lt;code&gt;paused&lt;/code&gt; with a &lt;code&gt;pausedReason&lt;/code&gt; (&lt;code&gt;device_offline&lt;/code&gt;, &lt;code&gt;device_reconnecting&lt;/code&gt; or &lt;code&gt;queue_full&lt;/code&gt;) and resumes from the next unsent recipient when the phone is back. The client does nothing.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I would not use this for
&lt;/h2&gt;

&lt;p&gt;Being clear about the ceiling has saved me more support time than any feature:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Fits:&lt;/strong&gt; appointment reminders, order updates, shift notices, club announcements. Dozens to a few hundred messages at a time, to people who gave you their number for this.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Fits with care:&lt;/strong&gt; a few thousand a month to a steady list, spread over days.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Does not fit:&lt;/strong&gt; cold marketing, purchased lists, tens of thousands a day. That is what a CPaaS provider and a short code are for, and pretending otherwise costs you the SIM.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What is still missing
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;No idempotency key yet. A repeated POST creates a second batch, so keep the &lt;code&gt;batchId&lt;/code&gt; and poll it.&lt;/li&gt;
&lt;li&gt;"Accepted" means the phone sent the message. There are no carrier delivery receipts yet.&lt;/li&gt;
&lt;li&gt;The pace is fixed per phone. It does not look at segment counts and slow down for long messages.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  If you want to try it
&lt;/h2&gt;

&lt;p&gt;The Android app is &lt;a href="https://play.google.com/store/apps/details?id=app.simgate.gateway" rel="noopener noreferrer"&gt;on Google Play&lt;/a&gt;, so there is no sideloading, and the free plan is enough to send a small batch and watch it leave at the paced rate.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Full endpoint reference: &lt;a href="https://www.simgate.app/blog/bulk-sms-api" rel="noopener noreferrer"&gt;Bulk SMS API guide&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;The numbers behind the limits: &lt;a href="https://www.simgate.app/blog/bulk-sms-android-phone-limits" rel="noopener noreferrer"&gt;What one SIM can really send&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;How it compares with the other phone-based gateways: &lt;a href="https://www.simgate.app/compare/android-sms-gateway-apps" rel="noopener noreferrer"&gt;Android SMS gateway apps compared&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you have run into &lt;code&gt;SmsUsageMonitor&lt;/code&gt; on a device where the manufacturer changed the threshold, I would like to hear which phone and what the number was.&lt;/p&gt;

</description>
      <category>android</category>
      <category>sms</category>
      <category>api</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Receive SMS in n8n and Auto-Reply From Your Own Number</title>
      <dc:creator>Nikola Mitrovic</dc:creator>
      <pubDate>Fri, 16 Oct 2026 09:02:14 +0000</pubDate>
      <link>https://dev.to/nikola_mitrovic_922e2665f/receive-sms-in-n8n-and-auto-reply-from-your-own-number-5d95</link>
      <guid>https://dev.to/nikola_mitrovic_922e2665f/receive-sms-in-n8n-and-auto-reply-from-your-own-number-5d95</guid>
      <description>&lt;p&gt;Text &lt;code&gt;HELP&lt;/code&gt; to your number. An n8n workflow picks up the incoming SMS, checks the keyword, and sends an acknowledgement from the same phone.&lt;/p&gt;

&lt;p&gt;That's what we'll build here: a two-way SMS workflow using an Android phone, its existing SIM card, and three n8n nodes. You can use the same pattern for support requests, appointment confirmations, or replies to notifications.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Disclosure:&lt;/strong&gt; I built SimGate, the Android SMS gateway used in this tutorial. I'll show the complete workflow, including the filtering code and the limitations of the starter template.&lt;/p&gt;

&lt;h2&gt;
  
  
  How the n8n SMS auto-reply works
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Someone texts HELP to your SIM number
  → Android phone receives the SMS
  → SimGate forwards the event to n8n
  → Code node checks the sender, device, and keyword
  → SimGate sends an acknowledgement to the sender
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;n8n handles the workflow logic. SimGate connects it to the Android phone. The phone sends the reply through its SIM, so the recipient sees that SIM's number.&lt;/p&gt;

&lt;p&gt;The starter only replies to one test sender through one configured device. It ignores other messages. This makes it easier to test the whole conversation before connecting customer records or other actions.&lt;/p&gt;

&lt;h2&gt;
  
  
  What you need
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;An Android phone with an active SIM that can send and receive SMS.&lt;/li&gt;
&lt;li&gt;The SimGate app installed and connected to your account.&lt;/li&gt;
&lt;li&gt;n8n Cloud or a self-hosted n8n instance.&lt;/li&gt;
&lt;li&gt;A separate phone you control to send the test message and receive the reply.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Keep the gateway phone powered and online, grant the app its SMS permissions, and confirm that the SIM can receive an ordinary text. If you haven't paired a phone yet, the &lt;a href="https://www.simgate.app/getting-started?utm_source=devto&amp;amp;utm_medium=referral&amp;amp;utm_campaign=n8n_auto_reply" rel="noopener noreferrer"&gt;SimGate setup guide&lt;/a&gt; includes a short video and the steps to connect it.&lt;/p&gt;

&lt;p&gt;For self-hosted n8n, your webhook URL must be publicly reachable over HTTPS. The hosted SimGate service cannot deliver an event to &lt;code&gt;localhost&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Sending uses your SIM plan and SimGate quota. n8n may also have subscription or hosting costs.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Install the SimGate nodes and add credentials
&lt;/h2&gt;

&lt;p&gt;SimGate is a &lt;a href="https://n8n.io/integrations/simgate/" rel="noopener noreferrer"&gt;verified n8n integration&lt;/a&gt;, available on n8n Cloud and self-hosted instances.&lt;/p&gt;

&lt;p&gt;Using an n8n owner or admin account:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Open a workflow and select &lt;strong&gt;+&lt;/strong&gt; to open the nodes panel.&lt;/li&gt;
&lt;li&gt;Search for &lt;strong&gt;SimGate&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Select the integration and choose &lt;strong&gt;Install&lt;/strong&gt;.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;You will use two nodes: &lt;strong&gt;SimGate Trigger&lt;/strong&gt; for incoming SMS and &lt;strong&gt;SimGate&lt;/strong&gt; for sending the reply.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fvnzx2e0o54981zks27bd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fvnzx2e0o54981zks27bd.png" alt="SimGate in the n8n nodes panel, showing SMS actions and the incoming SMS trigger" width="394" height="718"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Next, create an API key under &lt;strong&gt;API&lt;/strong&gt; in the SimGate dashboard. In n8n, create a &lt;strong&gt;SimGate API&lt;/strong&gt; credential:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Field&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;API Key&lt;/td&gt;
&lt;td&gt;Your dashboard API key&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Base URL&lt;/td&gt;
&lt;td&gt;&lt;code&gt;https://api.simgate.app&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Webhook Signing Secret&lt;/td&gt;
&lt;td&gt;Leave empty for automatic registration&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Use the credential's &lt;strong&gt;Test&lt;/strong&gt; button to check the connection. Store the key in this credential rather than in the Code node.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Import the SMS auto-reply workflow
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://www.simgate.app/workflows/simgate-inbound-help-reply.json" rel="noopener noreferrer"&gt;Download the n8n HELP auto-reply workflow JSON&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;In n8n, open the workflow menu, choose &lt;strong&gt;Import from File&lt;/strong&gt;, and select the downloaded JSON. The workflow imports inactive and contains three nodes:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Receive SMS → Prepare HELP reply → Send reply
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Before activating it:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Open &lt;strong&gt;Receive SMS&lt;/strong&gt;, select your SimGate API credential, and keep &lt;strong&gt;SMS Received&lt;/strong&gt; selected.&lt;/li&gt;
&lt;li&gt;Open &lt;strong&gt;Prepare HELP reply&lt;/strong&gt; and replace &lt;code&gt;REPLACE_WITH_YOUR_TEST_NUMBER&lt;/code&gt; with your separate test phone's number in international format, such as &lt;code&gt;+14155550100&lt;/code&gt;. Use your real test number; this is an example.&lt;/li&gt;
&lt;li&gt;Replace &lt;code&gt;REPLACE_WITH_DEVICE_ID&lt;/code&gt; with the gateway phone's device ID from your SimGate dashboard.&lt;/li&gt;
&lt;li&gt;Open &lt;strong&gt;Send reply&lt;/strong&gt; and select the same credential.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The following sections explain the payload and every part of the workflow. You can also build it manually with a SimGate Trigger, a Code node, and a SimGate send action.&lt;/p&gt;

&lt;p&gt;On activation, the trigger registers its webhook and captures the signing secret automatically. It verifies signed deliveries and checks that their timestamps are within five minutes of the n8n host's clock.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;One account has one webhook destination.&lt;/strong&gt; If your SimGate account already delivers events elsewhere, activation reports a conflict. Review the existing consumer before replacing it. For several inbound automations, use one trigger workflow and branch inside it.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Read the incoming SMS payload
&lt;/h2&gt;

&lt;p&gt;The SimGate Trigger emits the event directly as an n8n item. An example looks like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"3f8f0b16-84e3-4a37-9b0e-53b0d2d1d1a1"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"sms.received"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"createdAt"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"2026-10-03T09:12:44.001Z"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"data"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"deviceId"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"android-example-device"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"from"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"+14155550100"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"body"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"HELP"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"receivedAt"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"2026-10-03T09:12:43.880Z"&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The fields we'll use are:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Field&lt;/th&gt;
&lt;th&gt;Purpose&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;id&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Identify the event when adding deduplication&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;data.from&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Send the acknowledgement back to this number&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;data.body&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Match the incoming keyword&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;data.deviceId&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Reply through the phone that received the SMS&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;With the SimGate Trigger, the message text is at &lt;code&gt;$json.data.body&lt;/code&gt;. There is no extra &lt;code&gt;body&lt;/code&gt; wrapper around the event.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Match HELP in the Code node
&lt;/h2&gt;

&lt;p&gt;Set &lt;strong&gt;Prepare HELP reply&lt;/strong&gt; to &lt;strong&gt;Run Once for All Items&lt;/strong&gt;. This is the filtering code included in the download:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;allowedSender&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;REPLACE_WITH_YOUR_TEST_NUMBER&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;allowedDevice&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;REPLACE_WITH_DEVICE_ID&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;$input&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;all&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="nf"&gt;flatMap&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;item&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;index&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;event&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;item&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;json&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;data&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;event&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

  &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;event&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;type&lt;/span&gt; &lt;span class="o"&gt;!==&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;sms.received&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;event&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;[];&lt;/span&gt;
  &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="o"&gt;!==&lt;/span&gt; &lt;span class="nx"&gt;allowedSender&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;deviceId&lt;/span&gt; &lt;span class="o"&gt;!==&lt;/span&gt; &lt;span class="nx"&gt;allowedDevice&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;[];&lt;/span&gt;
  &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;typeof&lt;/span&gt; &lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;body&lt;/span&gt; &lt;span class="o"&gt;!==&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;string&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;body&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;trim&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="nf"&gt;toUpperCase&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;!==&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;HELP&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;[];&lt;/span&gt;
  &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="sr"&gt;/^&lt;/span&gt;&lt;span class="se"&gt;\+[&lt;/span&gt;&lt;span class="sr"&gt;1-9&lt;/span&gt;&lt;span class="se"&gt;]\d{6,14}&lt;/span&gt;&lt;span class="sr"&gt;$/&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;test&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="k"&gt;from&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;[];&lt;/span&gt;

  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;[{&lt;/span&gt;
    &lt;span class="na"&gt;json&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="na"&gt;eventId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;event&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;deviceId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;deviceId&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;phoneNumber&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="k"&gt;from&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;message&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Thanks for contacting us. A team member will help you shortly.&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="na"&gt;pairedItem&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;item&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;index&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;Replace the two configuration values before running it. The sender comparison is exact: use the format shown in your actual incoming event.&lt;/p&gt;

&lt;p&gt;The keyword check accepts &lt;code&gt;HELP&lt;/code&gt;, &lt;code&gt;help&lt;/code&gt;, and &lt;code&gt;HELP&lt;/code&gt;. It ignores &lt;code&gt;Hello&lt;/code&gt; and &lt;code&gt;I need help&lt;/code&gt;, because neither is the exact keyword after normalization. Returning an empty array stops those items from reaching the send action.&lt;/p&gt;

&lt;p&gt;Change the acknowledgement to match what your workflow actually does. This template sends a text; it doesn't create a support ticket. Add a helpdesk or CRM action if you promise follow-up.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Send the reply from the receiving device
&lt;/h2&gt;

&lt;p&gt;In &lt;strong&gt;Send reply&lt;/strong&gt;, select resource &lt;strong&gt;Message&lt;/strong&gt; and operation &lt;strong&gt;Send&lt;/strong&gt;. Set these fields to expressions:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Field&lt;/th&gt;
&lt;th&gt;Expression&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Device, using &lt;strong&gt;By ID&lt;/strong&gt;
&lt;/td&gt;
&lt;td&gt;&lt;code&gt;{{ $json.deviceId }}&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;To&lt;/td&gt;
&lt;td&gt;&lt;code&gt;{{ $json.phoneNumber }}&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Message&lt;/td&gt;
&lt;td&gt;&lt;code&gt;{{ $json.message }}&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;These are already configured in the imported workflow.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Test Mode still sends a real SMS.&lt;/strong&gt; It changes which SimGate quota is used. Keep it enabled for this pilot and use your own test recipient.&lt;/p&gt;

&lt;p&gt;The workflow selects the receiving phone, but it does not explicitly choose an outbound SIM slot. If that phone has two SIMs, check its sending configuration and verify which number the reply comes from.&lt;/p&gt;

&lt;h2&gt;
  
  
  6. Test a complete conversation
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Save and publish or activate the workflow after configuring the credentials and both placeholders.&lt;/li&gt;
&lt;li&gt;From your separate test phone, send &lt;code&gt;HELP&lt;/code&gt; to the gateway SIM's number.&lt;/li&gt;
&lt;li&gt;Open the new n8n execution. The trigger should contain the event, and &lt;strong&gt;Prepare HELP reply&lt;/strong&gt; should output one item.&lt;/li&gt;
&lt;li&gt;Check that &lt;strong&gt;Send reply&lt;/strong&gt; returns a message ID, then confirm that the acknowledgement reaches your test phone.&lt;/li&gt;
&lt;li&gt;Send &lt;code&gt;Hello&lt;/code&gt;. A new execution should start, but the Code node should output no items and send no reply.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;A successful send response means the command was accepted. To inspect its outcome, use another SimGate node with &lt;strong&gt;Message → Get&lt;/strong&gt; and the returned &lt;code&gt;messageId&lt;/code&gt;. Check the recipient phone to confirm receipt.&lt;/p&gt;

&lt;p&gt;The template leaves automatic send retries off. A timeout can happen after a command was accepted, so blindly repeating the send may create a second SMS. Inspect the execution and message status before retrying an uncertain result.&lt;/p&gt;

&lt;h2&gt;
  
  
  Before expanding beyond your test number
&lt;/h2&gt;

&lt;p&gt;The starter does not persist processed event IDs or enforce a cooldown. The same event delivered twice can produce two acknowledgements, even though only your allowed sender receives them.&lt;/p&gt;

&lt;h3&gt;
  
  
  Remember event IDs across executions
&lt;/h3&gt;

&lt;p&gt;Add a &lt;a href="https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.removeduplicates/" rel="noopener noreferrer"&gt;Remove Duplicates node&lt;/a&gt; between &lt;strong&gt;Prepare HELP reply&lt;/strong&gt; and &lt;strong&gt;Send reply&lt;/strong&gt;. Choose &lt;strong&gt;Remove Items Processed in Previous Executions&lt;/strong&gt;, set &lt;strong&gt;Keep Items Where&lt;/strong&gt; to &lt;strong&gt;Value Is New&lt;/strong&gt;, and use &lt;code&gt;{{ $json.eventId }}&lt;/code&gt; for &lt;strong&gt;Value to Dedupe On&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Its history is bounded. Also, remembering an event and sending an SMS are separate operations: a failure between them can leave the event recorded without a reply sent.&lt;/p&gt;

&lt;p&gt;For workflows that need recovery, store the event ID, processing state, outgoing message ID, and errors in a database with a unique event-ID constraint. Reconcile uncertain sends before trying again.&lt;/p&gt;

&lt;h3&gt;
  
  
  Limit replies and keep keyword matching narrow
&lt;/h3&gt;

&lt;p&gt;Store the last reply time by device and sender in a persistent database. A five-minute cooldown is one possible starting point. If executions can overlap, make the cooldown check and claim atomic.&lt;/p&gt;

&lt;p&gt;Keep exact keyword matching and exclude your own gateway numbers and known automated senders. Replying to every incoming text can create a conversation between two autoresponders.&lt;/p&gt;

&lt;p&gt;If you add subscription messaging, handle &lt;code&gt;STOP&lt;/code&gt; separately and store the contact's preference for your outbound workflows. This HELP template ignores &lt;code&gt;STOP&lt;/code&gt;; it doesn't implement opt-outs.&lt;/p&gt;

&lt;h3&gt;
  
  
  Monitor downstream failures
&lt;/h3&gt;

&lt;p&gt;The trigger acknowledges the webhook before downstream actions finish. Successful webhook delivery doesn't prove that the reply or a CRM update succeeded. Monitor failed n8n executions and keep enough state to recover unfinished work.&lt;/p&gt;

&lt;h2&gt;
  
  
  Troubleshooting
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Symptom&lt;/th&gt;
&lt;th&gt;What to check&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;No n8n execution&lt;/td&gt;
&lt;td&gt;Workflow activation, phone connection, SMS permissions, and the public HTTPS webhook URL&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;The phone shows a message, but no SMS event arrives&lt;/td&gt;
&lt;td&gt;Confirm the sender used SMS; an RCS chat or MMS is a different message type&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Trigger runs, but no reply&lt;/td&gt;
&lt;td&gt;Both placeholders, exact &lt;code&gt;data.from&lt;/code&gt; and &lt;code&gt;data.deviceId&lt;/code&gt; values, and whether the text matches &lt;code&gt;HELP&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Webhook conflict&lt;/td&gt;
&lt;td&gt;Another destination or temporary test listener may already use the account's webhook slot&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Signature or timestamp error&lt;/td&gt;
&lt;td&gt;The n8n host clock, current signing secret, and any proxy rewriting the request body&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Send returns successfully, but no SMS arrives&lt;/td&gt;
&lt;td&gt;Message status, gateway connectivity, quota, and the SIM's ability to send ordinary SMS&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Once this works, replace the HELP branch with your own routing: look up a booking, create a support ticket, or record a confirmation. For booking confirmations, include a booking reference when one sender can have several appointments; a plain &lt;code&gt;YES&lt;/code&gt; is otherwise ambiguous.&lt;/p&gt;

&lt;p&gt;What would you connect to incoming SMS first: appointment confirmations, support requests, or something else?&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Adapted from my &lt;a href="https://www.simgate.app/blog/receive-sms-n8n-auto-reply" rel="noopener noreferrer"&gt;original SimGate tutorial&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>n8n</category>
      <category>tutorial</category>
      <category>automation</category>
      <category>javascript</category>
    </item>
    <item>
      <title>How I turned an Android phone into an SMS API</title>
      <dc:creator>Nikola Mitrovic</dc:creator>
      <pubDate>Sat, 14 Mar 2026 09:03:22 +0000</pubDate>
      <link>https://dev.to/nikola_mitrovic_922e2665f/how-i-turned-an-android-phone-into-an-sms-api-38kc</link>
      <guid>https://dev.to/nikola_mitrovic_922e2665f/how-i-turned-an-android-phone-into-an-sms-api-38kc</guid>
      <description>&lt;p&gt;The story of SimGate (&lt;a href="https://simgate.app" rel="noopener noreferrer"&gt;https://simgate.app&lt;/a&gt;)&lt;/p&gt;

&lt;p&gt;SMS is still one of the most reliable ways to send notifications,&lt;br&gt;
alerts, and verification codes.&lt;/p&gt;

&lt;p&gt;But if you've ever looked at services like Twilio, you know the costs&lt;br&gt;
can add up quickly --- especially for small projects, internal tools, or&lt;br&gt;
experiments.&lt;/p&gt;

&lt;p&gt;So I started wondering:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;What if a regular Android phone could act as an SMS gateway?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Turns out... it can.&lt;/p&gt;

&lt;p&gt;Recently I built a small system that turns an Android phone into a&lt;br&gt;
programmable SMS API.&lt;/p&gt;


&lt;h2&gt;
  
  
  The idea
&lt;/h2&gt;

&lt;p&gt;Every Android phone already has:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  a SIM card&lt;/li&gt;
&lt;li&gt;  an SMS modem&lt;/li&gt;
&lt;li&gt;  an internet connection&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So instead of paying for SMS infrastructure, the phone itself can send&lt;br&gt;
messages.&lt;/p&gt;

&lt;p&gt;The missing piece is just connecting that phone to a backend.&lt;/p&gt;

&lt;p&gt;The architecture looks like this:&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Your App
   │
   ▼
REST API
   │
   ▼
WebSocket connection
   │
   ▼
Android phone
   │
   ▼
Carrier SMS network
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;Your backend sends a request → the phone receives it → the phone sends&lt;br&gt;
the SMS.&lt;/p&gt;


&lt;h2&gt;
  
  
  The architecture
&lt;/h2&gt;

&lt;p&gt;The system has three main parts.&lt;/p&gt;
&lt;h3&gt;
  
  
  1. Backend API
&lt;/h3&gt;

&lt;p&gt;The backend exposes a simple endpoint:&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;POST /send-sms
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;Example request:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"to"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"+381601234567"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"message"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Hello from API"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The backend does not send SMS directly. Instead it forwards the message&lt;br&gt;
to a connected device over WebSocket.&lt;/p&gt;


&lt;h3&gt;
  
  
  2. Persistent device connection
&lt;/h3&gt;

&lt;p&gt;When the Android app starts, it opens a WebSocket connection to the&lt;br&gt;
backend.&lt;/p&gt;

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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;socket&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;emit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;connectDevice&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;deviceId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;abc123&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now the backend knows that this specific phone is online.&lt;/p&gt;

&lt;p&gt;Whenever a new SMS request arrives, the backend pushes the message to&lt;br&gt;
that device.&lt;/p&gt;


&lt;h3&gt;
  
  
  3. Android SMS sender
&lt;/h3&gt;

&lt;p&gt;The Android app receives the message and sends it using the native SMS&lt;br&gt;
manager.&lt;/p&gt;

&lt;p&gt;On Android this is surprisingly simple:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="nc"&gt;SmsManager&lt;/span&gt; &lt;span class="n"&gt;smsManager&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;SmsManager&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;getDefault&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;
&lt;span class="n"&gt;smsManager&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;sendTextMessage&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;phoneNumber&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="n"&gt;message&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That's it.&lt;/p&gt;

&lt;p&gt;The phone sends the SMS through the carrier network just like any normal&lt;br&gt;
message.&lt;/p&gt;


&lt;h2&gt;
  
  
  Why this is interesting
&lt;/h2&gt;

&lt;p&gt;This approach has some interesting advantages.&lt;/p&gt;
&lt;h3&gt;
  
  
  No SMS provider required
&lt;/h3&gt;

&lt;p&gt;You don't need Twilio, Nexmo, or other gateways.&lt;/p&gt;

&lt;p&gt;The SIM card in the phone handles everything.&lt;/p&gt;


&lt;h3&gt;
  
  
  Extremely cheap
&lt;/h3&gt;

&lt;p&gt;If you already have:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  a spare Android phone&lt;/li&gt;
&lt;li&gt;  a SIM card with SMS included&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Then your cost is basically zero.&lt;/p&gt;


&lt;h3&gt;
  
  
  Useful for internal tools
&lt;/h3&gt;

&lt;p&gt;This setup works well for things like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  server alerts&lt;/li&gt;
&lt;li&gt;  IoT notifications&lt;/li&gt;
&lt;li&gt;  internal automation&lt;/li&gt;
&lt;li&gt;  dev experiments&lt;/li&gt;
&lt;li&gt;  sending messages in regions where SMS APIs are limited&lt;/li&gt;
&lt;/ul&gt;


&lt;h2&gt;
  
  
  Challenges I ran into
&lt;/h2&gt;

&lt;p&gt;This was not completely trivial.&lt;/p&gt;

&lt;p&gt;Some problems that needed solving:&lt;/p&gt;
&lt;h3&gt;
  
  
  Persistent connectivity
&lt;/h3&gt;

&lt;p&gt;Phones disconnect from networks frequently.&lt;/p&gt;

&lt;p&gt;Keeping a reliable WebSocket connection required retry logic and&lt;br&gt;
heartbeat checks.&lt;/p&gt;


&lt;h3&gt;
  
  
  Device registration
&lt;/h3&gt;

&lt;p&gt;Each phone needs a unique identity so the backend knows where to route&lt;br&gt;
SMS messages.&lt;/p&gt;

&lt;p&gt;I solved this by generating a device ID during registration and pairing&lt;br&gt;
it with the API key.&lt;/p&gt;


&lt;h3&gt;
  
  
  Background restrictions
&lt;/h3&gt;

&lt;p&gt;Android can aggressively kill background processes.&lt;/p&gt;

&lt;p&gt;The app needs to run as a foreground service to stay alive reliably.&lt;/p&gt;


&lt;h2&gt;
  
  
  Example workflow
&lt;/h2&gt;

&lt;p&gt;Once everything is connected, sending SMS looks like this.&lt;/p&gt;

&lt;p&gt;Example request:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl https://api.example.com/send-sms   &lt;span class="nt"&gt;-H&lt;/span&gt; &lt;span class="s2"&gt;"Authorization: Bearer API_KEY"&lt;/span&gt;   &lt;span class="nt"&gt;-H&lt;/span&gt; &lt;span class="s2"&gt;"Content-Type: application/json"&lt;/span&gt;   &lt;span class="nt"&gt;-d&lt;/span&gt; &lt;span class="s1"&gt;'{
        "to": "+381601234567",
        "message": "Server is back online"
      }'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The connected phone immediately sends the SMS.&lt;/p&gt;




&lt;h2&gt;
  
  
  Why I built this
&lt;/h2&gt;

&lt;p&gt;Originally this started as an experiment to see if it was possible to&lt;br&gt;
build a simple SMS gateway using commodity hardware.&lt;/p&gt;

&lt;p&gt;After getting it working, I turned it into a small service called&lt;br&gt;
SimGate that lets you connect a phone and send SMS through an API.&lt;/p&gt;

&lt;p&gt;The idea is simple:&lt;/p&gt;

&lt;p&gt;Phone + SIM → SMS API&lt;/p&gt;

&lt;p&gt;If you're curious or want to try it:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://simgate.app" rel="noopener noreferrer"&gt;https://simgate.app&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I'd also love to hear how other people handle SMS in small projects or&lt;br&gt;
internal tooling.&lt;/p&gt;

&lt;p&gt;Are you using:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  Twilio&lt;/li&gt;
&lt;li&gt;  self-hosted GSM modems&lt;/li&gt;
&lt;li&gt;  Android devices&lt;/li&gt;
&lt;li&gt;  something else entirely?&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>webdev</category>
      <category>sms</category>
      <category>api</category>
      <category>smsapi</category>
    </item>
    <item>
      <title>Automating Supplier Order Emails: Stop Copy-Pasting from Your Inbox</title>
      <dc:creator>Nikola Mitrovic</dc:creator>
      <pubDate>Fri, 06 Mar 2026 10:05:46 +0000</pubDate>
      <link>https://dev.to/nikola_mitrovic_922e2665f/automating-supplier-order-emails-stop-copy-pasting-from-your-inbox-25fn</link>
      <guid>https://dev.to/nikola_mitrovic_922e2665f/automating-supplier-order-emails-stop-copy-pasting-from-your-inbox-25fn</guid>
      <description>&lt;h2&gt;
  
  
  The Problem
&lt;/h2&gt;

&lt;p&gt;Most B2B operations still run on email. Your suppliers send order confirmations, shipping notices, and invoices to a shared inbox, and someone on your team manually copies data into your system. It's tedious, error-prone, and doesn't scale.&lt;/p&gt;

&lt;p&gt;After building this automation three times across different companies, here's the approach that actually works in production.&lt;/p&gt;

&lt;h2&gt;
  
  
  Architecture Overview
&lt;/h2&gt;

&lt;p&gt;You need three components:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Email receiver&lt;/strong&gt; — captures inbound messages (IMAP polling or webhook)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Parser&lt;/strong&gt; — extracts structured data from email body/attachments&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Integrator&lt;/strong&gt; — pushes parsed data to your database or ERP&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The tricky part isn't any single piece—it's handling the chaos of real-world supplier emails. One vendor sends PDFs, another uses plain text with inconsistent formatting, and a third embeds everything in HTML tables.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Node.js Implementation
&lt;/h2&gt;

&lt;p&gt;Here's a minimal example using &lt;code&gt;imap-simple&lt;/code&gt; and some regex parsing. This listens for new emails, extracts order numbers and totals, then logs them:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;imaps&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;imap-simple&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;simpleParser&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;mailparser&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;config&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;imap&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;user&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;EMAIL_USER&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;password&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;EMAIL_PASSWORD&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;host&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;imap.gmail.com&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;port&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;993&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;tls&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;tlsOptions&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;rejectUnauthorized&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&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="k"&gt;async&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;processOrders&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;connection&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;imaps&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;connect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;config&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;connection&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;openBox&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;INBOX&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;searchCriteria&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;UNSEEN&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;FROM&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;orders@supplier.com&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;]];&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;fetchOptions&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;bodies&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;''&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="na"&gt;markSeen&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt; &lt;span class="p"&gt;};&lt;/span&gt;

  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;messages&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;connection&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;search&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;searchCriteria&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;fetchOptions&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

  &lt;span class="k"&gt;for &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;item&lt;/span&gt; &lt;span class="k"&gt;of&lt;/span&gt; &lt;span class="nx"&gt;messages&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;all&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;item&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;parts&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;find&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;part&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;part&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;which&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="dl"&gt;''&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;parsed&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;simpleParser&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;all&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;body&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="c1"&gt;// Extract order details (customize per supplier)&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;orderMatch&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;parsed&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;text&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;match&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sr"&gt;/Order #&lt;/span&gt;&lt;span class="se"&gt;(\d&lt;/span&gt;&lt;span class="sr"&gt;+&lt;/span&gt;&lt;span class="se"&gt;)&lt;/span&gt;&lt;span class="sr"&gt;/&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;totalMatch&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;parsed&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;text&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;match&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sr"&gt;/Total: &lt;/span&gt;&lt;span class="se"&gt;\$([\d&lt;/span&gt;&lt;span class="sr"&gt;,&lt;/span&gt;&lt;span class="se"&gt;]&lt;/span&gt;&lt;span class="sr"&gt;+&lt;/span&gt;&lt;span class="se"&gt;\.\d{2})&lt;/span&gt;&lt;span class="sr"&gt;/&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;orderMatch&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nx"&gt;totalMatch&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;order&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="na"&gt;orderNumber&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;orderMatch&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
        &lt;span class="na"&gt;total&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nf"&gt;parseFloat&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;totalMatch&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nf"&gt;replace&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;,&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;''&lt;/span&gt;&lt;span class="p"&gt;)),&lt;/span&gt;
        &lt;span class="na"&gt;receivedAt&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Date&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
      &lt;span class="p"&gt;};&lt;/span&gt;

      &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Parsed order:&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;order&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
      &lt;span class="c1"&gt;// await saveToDatabase(order);&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;

  &lt;span class="nx"&gt;connection&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;end&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nf"&gt;processOrders&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="k"&gt;catch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  What This Doesn't Handle
&lt;/h2&gt;

&lt;p&gt;This snippet works for demos, but production needs:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Multi-vendor parsing logic&lt;/strong&gt; — each supplier has different formats&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;PDF extraction&lt;/strong&gt; — many orders come as attachments&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Retry logic&lt;/strong&gt; — emails sometimes arrive out of order or get corrupted&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Schema validation&lt;/strong&gt; — ensuring extracted data matches your database constraints&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Monitoring&lt;/strong&gt; — you need alerts when parsing fails&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Building all of this from scratch takes weeks. You'll write custom parsers for each supplier, handle authentication edge cases, and spend weekends debugging why one vendor's emails suddenly changed format.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Real Cost
&lt;/h2&gt;

&lt;p&gt;Maintenance is the killer. Suppliers change their email templates without warning. Your regex breaks. Someone has to debug it at 9 PM because orders aren't flowing through.&lt;/p&gt;

&lt;p&gt;The automation saves time compared to manual entry, but only if you account for the ongoing maintenance burden. If you're processing fewer than 50 orders per day, honestly, the manual approach might cost less in total engineering time.&lt;/p&gt;

&lt;h2&gt;
  
  
  Try ParseForce
&lt;/h2&gt;

&lt;p&gt;If you'd rather skip the plumbing entirely, check out &lt;a href="https://parseforce.io/" rel="noopener noreferrer"&gt;ParseForce&lt;/a&gt; — it handles inbound email parsing, schema validation, and webhook delivery out of the box. The architecture is solid for teams that want to focus on business logic instead of email infrastructure.&lt;/p&gt;

</description>
      <category>node</category>
      <category>automation</category>
      <category>webdev</category>
      <category>ai</category>
    </item>
    <item>
      <title>Parsing Incoming Emails into Structured JSON with Node and AI</title>
      <dc:creator>Nikola Mitrovic</dc:creator>
      <pubDate>Tue, 03 Mar 2026 10:48:21 +0000</pubDate>
      <link>https://dev.to/nikola_mitrovic_922e2665f/parsing-incoming-emails-into-structured-json-with-node-and-ai-2979</link>
      <guid>https://dev.to/nikola_mitrovic_922e2665f/parsing-incoming-emails-into-structured-json-with-node-and-ai-2979</guid>
      <description>&lt;p&gt;Email is still one of the most common “integration APIs” in business and that's why I made &lt;a href="https://www.parseforce.io" rel="noopener noreferrer"&gt;https://www.parseforce.io&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Invoices. Shipping notices. Order confirmations. Supplier updates.&lt;/p&gt;

&lt;p&gt;And in many cases… email is the &lt;em&gt;only&lt;/em&gt; integration point you get.&lt;/p&gt;

&lt;p&gt;The problem?&lt;/p&gt;

&lt;p&gt;Emails are messy.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Layout changes&lt;/li&gt;
&lt;li&gt;Forwarded threads&lt;/li&gt;
&lt;li&gt;HTML formatting&lt;/li&gt;
&lt;li&gt;Different senders, different structures&lt;/li&gt;
&lt;li&gt;Slight wording tweaks that break everything&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Yet inside those emails is structured data you actually need.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Regex Trap
&lt;/h2&gt;

&lt;p&gt;Most teams start with regex or template-based parsing.&lt;/p&gt;

&lt;p&gt;It works at first:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const match = emailBody.match(/Total:\s*\$([0-9,\.]+)/);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then one day:&lt;/p&gt;

&lt;p&gt;“Total” becomes “Amount Due”&lt;/p&gt;

&lt;p&gt;The currency moves&lt;/p&gt;

&lt;p&gt;The supplier updates their template&lt;/p&gt;

&lt;p&gt;Someone forwards the email&lt;/p&gt;

&lt;p&gt;And your parser breaks.&lt;/p&gt;

&lt;p&gt;You’re now maintaining parsing logic instead of building product.&lt;/p&gt;

&lt;p&gt;A Different Approach&lt;/p&gt;

&lt;p&gt;Instead of matching patterns, define the schema you want:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
  "invoiceNumber": "string",
  "items": [],
  "total": "number",
  "currency": "string"
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then extract structured JSON that conforms to that schema.&lt;/p&gt;

&lt;p&gt;Your workflow becomes:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Incoming email
↓
Extract structured data
↓
Validate
↓
Send to webhook
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now your backend only deals with clean JSON.&lt;/p&gt;

&lt;p&gt;Making Email Feel Like Webhooks&lt;/p&gt;

&lt;p&gt;The goal is simple:&lt;/p&gt;

&lt;p&gt;Turn this:&lt;/p&gt;

&lt;p&gt;email → chaos&lt;/p&gt;

&lt;p&gt;Into this:&lt;/p&gt;

&lt;p&gt;email → structured JSON → webhook&lt;/p&gt;

&lt;p&gt;So your systems can treat email like any other API input.&lt;/p&gt;

&lt;p&gt;A Practical Note&lt;/p&gt;

&lt;p&gt;If you go this route:&lt;/p&gt;

&lt;p&gt;Always store raw emails&lt;/p&gt;

&lt;p&gt;Validate extracted fields&lt;/p&gt;

&lt;p&gt;Handle low-confidence cases&lt;/p&gt;

&lt;p&gt;Expect edge cases&lt;/p&gt;

&lt;p&gt;Email isn’t going away.&lt;br&gt;
But it doesn’t have to be painful.&lt;br&gt;
More details about the &lt;a href="https://www.parseforce.io" rel="noopener noreferrer"&gt;tool&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>ai</category>
      <category>javascript</category>
      <category>programming</category>
    </item>
    <item>
      <title>I tried parsing emails with regex. It went exactly how you think.</title>
      <dc:creator>Nikola Mitrovic</dc:creator>
      <pubDate>Mon, 02 Mar 2026 15:24:14 +0000</pubDate>
      <link>https://dev.to/nikola_mitrovic_922e2665f/i-tried-parsing-emails-with-regex-it-went-exactly-how-you-think-2j9c</link>
      <guid>https://dev.to/nikola_mitrovic_922e2665f/i-tried-parsing-emails-with-regex-it-went-exactly-how-you-think-2j9c</guid>
      <description>&lt;p&gt;Recently I needed to &lt;strong&gt;process incoming emails automatically&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The idea sounded simple:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Email arrives → extract some fields → trigger a webhook&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Things like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;order confirmations
&lt;/li&gt;
&lt;li&gt;invoice emails
&lt;/li&gt;
&lt;li&gt;shipping notifications
&lt;/li&gt;
&lt;li&gt;support messages
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Nothing complicated.&lt;/p&gt;

&lt;p&gt;Or so I thought.&lt;/p&gt;




&lt;h2&gt;
  
  
  Attempt #1 — Regex
&lt;/h2&gt;

&lt;p&gt;Like most developers, I started with regex.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const price = email.match(/Total:\s\$(\d+)/)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;For the first email it worked perfectly.&lt;/p&gt;

&lt;p&gt;Then the next email came in and said:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Amount paid: $29
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Then another one said:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Total price: USD 29
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Then an HTML email arrived with nested tables, inline styles, and formatting from what looked like &lt;strong&gt;2004 Outlook templates&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;At this point my regex slowly evolved into something like this:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;/(Total|Amount|Price).*?(\$|USD)?\s?(\d+(\.\d+)?)/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Which is usually the moment you realize the approach is already doomed.&lt;/p&gt;




&lt;h2&gt;
  
  
  Attempt #2 — Parsing the HTML
&lt;/h2&gt;

&lt;p&gt;Okay fine.&lt;/p&gt;

&lt;p&gt;Let's parse the HTML instead.&lt;/p&gt;

&lt;p&gt;That led to code like this:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const dom = new JSDOM(emailHtml)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Which &lt;em&gt;sometimes&lt;/em&gt; worked.&lt;/p&gt;

&lt;p&gt;Except email HTML is a special kind of chaos.&lt;/p&gt;

&lt;p&gt;You get:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;tables inside tables
&lt;/li&gt;
&lt;li&gt;inline styles everywhere
&lt;/li&gt;
&lt;li&gt;different layouts for every sender
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And suddenly you're maintaining &lt;strong&gt;custom parsers for every email format&lt;/strong&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  The real problem
&lt;/h2&gt;

&lt;p&gt;Emails aren't structured data.&lt;/p&gt;

&lt;p&gt;They're &lt;strong&gt;written for humans&lt;/strong&gt;, not machines.&lt;/p&gt;

&lt;p&gt;And every sender formats them differently.&lt;/p&gt;

&lt;p&gt;Trying to enforce rigid parsing rules becomes fragile very quickly.&lt;/p&gt;




&lt;h2&gt;
  
  
  The obvious solution (in hindsight)
&lt;/h2&gt;

&lt;p&gt;Instead of trying to force strict parsing rules…&lt;/p&gt;

&lt;p&gt;Why not let &lt;strong&gt;AI interpret the email&lt;/strong&gt; and extract the fields you want?&lt;/p&gt;

&lt;p&gt;Example email:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Subject: Order confirmation
Customer: John Smith
Product: T-shirt
Total: $39
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Structured output:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
  "customer": "John Smith",
  "product": "T-shirt",
  "total": 39
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Now your backend receives &lt;strong&gt;clean structured data&lt;/strong&gt; instead of raw email text.&lt;/p&gt;




&lt;h2&gt;
  
  
  So I built a small tool
&lt;/h2&gt;

&lt;p&gt;Mostly because I kept running into this problem again and again.&lt;/p&gt;

&lt;p&gt;It's called &lt;strong&gt;ParseForce&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The flow is simple:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Incoming email → AI parsing → structured JSON → webhook
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;You:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Get a &lt;strong&gt;unique inbox&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Send emails to it&lt;/li&gt;
&lt;li&gt;Define the schema you want&lt;/li&gt;
&lt;li&gt;Receive &lt;strong&gt;structured JSON in your webhook&lt;/strong&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;That's it.&lt;/p&gt;




&lt;h2&gt;
  
  
  Some things it works well for
&lt;/h2&gt;

&lt;p&gt;So far I've been using it for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;parsing &lt;strong&gt;order confirmation emails&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;extracting &lt;strong&gt;invoice data&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;processing &lt;strong&gt;lead emails&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;triggering &lt;strong&gt;automation workflows&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Basically anything where an email contains &lt;strong&gt;data you want your system to understand&lt;/strong&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  If you're curious
&lt;/h2&gt;

&lt;p&gt;You can check it out here:&lt;/p&gt;

&lt;p&gt;👉 &lt;a href="https://parseforce.io" rel="noopener noreferrer"&gt;https://parseforce.io&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I'm also curious how others deal with this problem.&lt;/p&gt;

&lt;p&gt;Are you using regex, templates, or something else entirely?&lt;/p&gt;




&lt;h1&gt;
  
  
  node #webdev #saas #automation #ai
&lt;/h1&gt;

</description>
    </item>
    <item>
      <title>How I’m Building an AI Try-On Tool for Clothing Brands (Behind the Scenes)</title>
      <dc:creator>Nikola Mitrovic</dc:creator>
      <pubDate>Wed, 10 Dec 2025 20:03:32 +0000</pubDate>
      <link>https://dev.to/nikola_mitrovic_922e2665f/how-im-building-an-ai-try-on-tool-for-clothing-brands-behind-the-scenes-3pmc</link>
      <guid>https://dev.to/nikola_mitrovic_922e2665f/how-im-building-an-ai-try-on-tool-for-clothing-brands-behind-the-scenes-3pmc</guid>
      <description>&lt;p&gt;Over the past few months, I’ve been working closely with a few small clothing brands, and one problem kept coming up in every conversation:&lt;/p&gt;

&lt;p&gt;“We can get new inventory fast… but product photos slow everything down.”&lt;/p&gt;

&lt;p&gt;That fascinated me. Most boutiques spend:&lt;br&gt;
days coordinating photoshoots&lt;br&gt;
money on models + photographers&lt;br&gt;
time editing everything&lt;br&gt;
and meanwhile, new items sit in inventory waiting for photos&lt;br&gt;
One boutique owner told me:&lt;br&gt;
“I can add products to Shopify the same day I get them, but photos take 2–3 weeks. I lose sales every time.”&lt;br&gt;
That sentence is basically what kicked off this whole project.&lt;/p&gt;

&lt;p&gt;🧪 Early experiments&lt;br&gt;
I started by playing with background removal tools, virtual studios, early AI generation models, pose-transfer models&lt;br&gt;
Results were… okay-ish. Cool tech, but nothing you’d confidently publish on a real store.&lt;/p&gt;

&lt;p&gt;What I really wanted was something like:&lt;br&gt;
Upload garment → get realistic model photo → done&lt;br&gt;
No photoshoot, no scheduling, no waiting.&lt;/p&gt;

&lt;p&gt;⚙️ The tech stack I’m using&lt;br&gt;
Right now the project is built with:&lt;br&gt;
Next.js (frontend)&lt;br&gt;
Supabase (auth + storage)&lt;br&gt;
Fal.ai (AI inference endpoints)&lt;br&gt;
Vercel (hosting)&lt;/p&gt;

&lt;p&gt;The flow looks like this: User uploads a garment image -&amp;gt; It runs through preprocessing (crop, contour detection, smoothing) -&amp;gt; Sent to an AI model for realistic try-on -&amp;gt; Post-processing improves lighting + consistency -&amp;gt; delivered as a final product photo&lt;/p&gt;

&lt;p&gt;Still improving it — realism is the hardest part but now it's more realistic than others that I played with.&lt;/p&gt;

&lt;p&gt;🎯 The goal&lt;br&gt;
I’m trying to answer one simple question:&lt;br&gt;
“Can small clothing brands get store-ready model photos without photoshoots?”&lt;br&gt;
I’m not sure yet, but early tests have been promising enough to keep building.&lt;br&gt;
Some brands loved it:&lt;br&gt;
“This saves me days.”&lt;br&gt;
Some weren’t ready:&lt;br&gt;
“I still prefer real models.”&lt;br&gt;
Understanding that gap is part of this whole journey.&lt;/p&gt;

&lt;p&gt;🚀 Launching soon on Product Hunt&lt;br&gt;
I’m planning to launch the project on Product Hunt soon (next week).&lt;br&gt;
If you like AI + e-commerce + build-in-public stuff, I’ll share the link when it goes live.&lt;br&gt;
Would love any thoughts, feedback, or questions — especially from developers working with:&lt;br&gt;
generative models&lt;br&gt;
computer vision&lt;br&gt;
e-commerce automation&lt;br&gt;
apparel tech&lt;br&gt;
Happy to nerd out on the technical side if anyone’s interested.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.fitsnapai.app" rel="noopener noreferrer"&gt;https://www.fitsnapai.app&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Results:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1xg1n0tof0o5cnvdoeqm.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1xg1n0tof0o5cnvdoeqm.png" alt=" " width="800" height="665"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftfde1lsvsoqru3lrrsb7.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftfde1lsvsoqru3lrrsb7.jpg" alt=" " width="" height=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fklpxizdts46363fz8b7d.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fklpxizdts46363fz8b7d.jpg" alt=" " width="800" height="656"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2d9bm3v3hrqj6jieqneo.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2d9bm3v3hrqj6jieqneo.jpg" alt=" " width="768" height="1376"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>webdev</category>
      <category>nanobanana</category>
      <category>saas</category>
    </item>
    <item>
      <title>Interested in SMS over API using your own SIM card?</title>
      <dc:creator>Nikola Mitrovic</dc:creator>
      <pubDate>Sat, 13 Sep 2025 15:06:32 +0000</pubDate>
      <link>https://dev.to/nikola_mitrovic_922e2665f/-2n5a</link>
      <guid>https://dev.to/nikola_mitrovic_922e2665f/-2n5a</guid>
      <description>&lt;div class="ltag__link--embedded"&gt;
  &lt;div class="crayons-story "&gt;
  &lt;a href="https://dev.to/nikola_mitrovic_922e2665f/how-i-send-sms-from-my-react-app-using-my-own-phone-and-sim-card-4n0p" class="crayons-story__hidden-navigation-link"&gt;How I Send SMS From My React App Using My Own Phone and SIM Card&lt;/a&gt;


  &lt;div class="crayons-story__body crayons-story__body-full_post"&gt;
    &lt;div class="crayons-story__top"&gt;
      &lt;div class="crayons-story__meta"&gt;
        &lt;div class="crayons-story__author-pic"&gt;

          &lt;a href="/nikola_mitrovic_922e2665f" class="crayons-avatar  crayons-avatar--l  "&gt;
            &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3395259%2Fe08340c0-33f8-4378-bf06-27110a0e1553.png" alt="nikola_mitrovic_922e2665f profile" class="crayons-avatar__image" width="96" height="96"&gt;
          &lt;/a&gt;
        &lt;/div&gt;
        &lt;div&gt;
          &lt;div&gt;
            &lt;a href="/nikola_mitrovic_922e2665f" class="crayons-story__secondary fw-medium m:hidden"&gt;
              Nikola Mitrovic
            &lt;/a&gt;
            &lt;div class="profile-preview-card relative mb-4 s:mb-0 fw-medium hidden m:inline-block"&gt;
              
                Nikola Mitrovic
                
                
              
              &lt;div id="story-author-preview-content-2843052" class="profile-preview-card__content crayons-dropdown branded-7 p-4 pt-0"&gt;
                &lt;div class="gap-4 grid"&gt;
                  &lt;div class="-mt-4"&gt;
                    &lt;a href="/nikola_mitrovic_922e2665f" class="flex"&gt;
                      &lt;span class="crayons-avatar crayons-avatar--xl mr-2 shrink-0"&gt;
                        &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3395259%2Fe08340c0-33f8-4378-bf06-27110a0e1553.png" class="crayons-avatar__image" alt="" width="96" height="96"&gt;
                      &lt;/span&gt;
                      &lt;span class="crayons-link crayons-subtitle-2 mt-5"&gt;Nikola Mitrovic&lt;/span&gt;
                    &lt;/a&gt;
                  &lt;/div&gt;
                  &lt;div class="print-hidden"&gt;
                    
                      Follow
                    
                  &lt;/div&gt;
                  &lt;div class="author-preview-metadata-container"&gt;&lt;/div&gt;
                &lt;/div&gt;
              &lt;/div&gt;
            &lt;/div&gt;

          &lt;/div&gt;
          &lt;a href="https://dev.to/nikola_mitrovic_922e2665f/how-i-send-sms-from-my-react-app-using-my-own-phone-and-sim-card-4n0p" class="crayons-story__tertiary fs-xs"&gt;&lt;time&gt;Sep 13 '25&lt;/time&gt;&lt;span class="time-ago-indicator-initial-placeholder"&gt;&lt;/span&gt;&lt;/a&gt;
        &lt;/div&gt;
      &lt;/div&gt;

    &lt;/div&gt;

    &lt;div class="crayons-story__indention"&gt;
      &lt;h2 class="crayons-story__title crayons-story__title-full_post"&gt;
        &lt;a href="https://dev.to/nikola_mitrovic_922e2665f/how-i-send-sms-from-my-react-app-using-my-own-phone-and-sim-card-4n0p" id="article-link-2843052"&gt;
          How I Send SMS From My React App Using My Own Phone and SIM Card
        &lt;/a&gt;
      &lt;/h2&gt;
        &lt;div class="crayons-story__tags"&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/react"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;react&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/webdev"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;webdev&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/sms"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;sms&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/api"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;api&lt;/a&gt;
        &lt;/div&gt;
      &lt;div class="crayons-story__bottom"&gt;
        &lt;div class="crayons-story__details"&gt;
          &lt;a href="https://dev.to/nikola_mitrovic_922e2665f/how-i-send-sms-from-my-react-app-using-my-own-phone-and-sim-card-4n0p" class="crayons-btn crayons-btn--s crayons-btn--ghost crayons-btn--icon-left"&gt;
            &lt;div class="multiple_reactions_aggregate"&gt;
              &lt;span class="multiple_reactions_icons_container"&gt;
                  &lt;span class="crayons_icon_container"&gt;
                    &lt;img src="https://assets.dev.to/assets/sparkle-heart-5f9bee3767e18deb1bb725290cb151c25234768a0e9a2bd39370c382d02920cf.svg" width="24" height="24"&gt;
                  &lt;/span&gt;
              &lt;/span&gt;
              &lt;span class="aggregate_reactions_counter"&gt;1&lt;span class="hidden s:inline"&gt;&amp;nbsp;reaction&lt;/span&gt;&lt;/span&gt;
            &lt;/div&gt;
          &lt;/a&gt;
            &lt;a href="https://dev.to/nikola_mitrovic_922e2665f/how-i-send-sms-from-my-react-app-using-my-own-phone-and-sim-card-4n0p#comments" class="crayons-btn crayons-btn--s crayons-btn--ghost crayons-btn--icon-left flex items-center"&gt;
              

              &lt;span class="hidden s:inline"&gt;Add&amp;nbsp;Comment&lt;/span&gt;
            &lt;/a&gt;
        &lt;/div&gt;
        &lt;div class="crayons-story__save"&gt;
          &lt;small class="crayons-story__tertiary fs-xs mr-2"&gt;
            2 min read
          &lt;/small&gt;
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;/div&gt;


</description>
      <category>react</category>
      <category>webdev</category>
      <category>sms</category>
      <category>api</category>
    </item>
    <item>
      <title>How I Send SMS From My React App Using My Own Phone and SIM Card</title>
      <dc:creator>Nikola Mitrovic</dc:creator>
      <pubDate>Sat, 13 Sep 2025 13:07:48 +0000</pubDate>
      <link>https://dev.to/nikola_mitrovic_922e2665f/how-i-send-sms-from-my-react-app-using-my-own-phone-and-sim-card-4n0p</link>
      <guid>https://dev.to/nikola_mitrovic_922e2665f/how-i-send-sms-from-my-react-app-using-my-own-phone-and-sim-card-4n0p</guid>
      <description>&lt;p&gt;Most tutorials on “sending SMS from your app” point you to services like Twilio, where you pay per message. That’s fine for small projects, but once you start sending a lot of texts, those charges add up quickly.&lt;/p&gt;

&lt;p&gt;I wanted something different: a way to send SMS without paying a third-party provider — just using my own Android phone and SIM card. That’s why I built &lt;a href="https://www.simgate.app" rel="noopener noreferrer"&gt;SimGate&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;In this post I’ll show you how I wired up my phone to send an SMS directly from a simple React app with just one API call.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;The idea&lt;br&gt;
Install an app on your Android phone.&lt;br&gt;
The app connects to &lt;a href="https://www.simgate.app" rel="noopener noreferrer"&gt;SimGate&lt;/a&gt; and exposes an API endpoint.&lt;br&gt;
Your frontend or backend makes a POST request with the phone number + message.&lt;br&gt;
Your phone’s SIM card sends the SMS.&lt;br&gt;
No middleman. No per-SMS fee. Just your device and your mobile plan.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Setting up the phone&lt;br&gt;
Install the SimGate Android app.&lt;br&gt;
Log in and register the device.&lt;br&gt;
The app generates an API key you’ll use in your code.&lt;br&gt;
That’s it — your phone is now ready to act as a mini SMS gateway.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;3.Sending an SMS:&lt;/p&gt;

&lt;p&gt;Here’s the simplest possible curl example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;curl -X POST https://api.simgate.app/v1/sms/send \
  -H "Content-Type: application/json" \
  -H "x-api-key: &amp;lt;YOUR_API_KEY&amp;gt;" \
  -d '{
    "deviceId": "&amp;lt;YOUR_DEVICE_ID&amp;gt;",
    "to": "+15551234567",
    "message": "SMS from curl"
  }'
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Sending it from react is quite simple:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;async function sendSms() {
  const res = await fetch("https://api.simgate.app/v1/sms/send", {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
      "x-api-key": "&amp;lt;YOUR_API_KEY&amp;gt;",
    },
    body: JSON.stringify({
      deviceId: "&amp;lt;YOUR_DEVICE_ID&amp;gt;",
      to: "+15551234567",
      message: "Hello from my React app",
    }),
  });

  const data = await res.json();
  console.log("SMS response:", data);
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;As long as your phone has connection SMS is shipped!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.simgate.app" rel="noopener noreferrer"&gt;https://www.simgate.app&lt;/a&gt;&lt;/p&gt;

</description>
      <category>react</category>
      <category>webdev</category>
      <category>sms</category>
      <category>api</category>
    </item>
    <item>
      <title>Why I’m building SimGate: An SMS API without per-message fees</title>
      <dc:creator>Nikola Mitrovic</dc:creator>
      <pubDate>Mon, 28 Jul 2025 20:46:36 +0000</pubDate>
      <link>https://dev.to/nikola_mitrovic_922e2665f/why-im-building-simgate-an-sms-api-without-per-message-fees-16mm</link>
      <guid>https://dev.to/nikola_mitrovic_922e2665f/why-im-building-simgate-an-sms-api-without-per-message-fees-16mm</guid>
      <description>&lt;p&gt;I’m a full-stack developer who’s always looking for simple, affordable tools, especially when building for side projects or indie SaaS ideas.&lt;/p&gt;

&lt;p&gt;Recently, I ran into a familiar problem:&lt;br&gt;
Sending SMS through APIs like Twilio gets expensive fast.&lt;br&gt;
Even basic features like 2FA or delivery alerts can become unsustainable when you're paying per message, especially on low-margin or small-scale projects.&lt;/p&gt;

&lt;p&gt;That’s when I decided to build SimGate — a lightweight developer tool that lets you send SMS through your own Android phone and SIM card, using a clean API, without per-message fees.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Who is SimGate for?&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Indie devs building internal tools or MVPs&lt;/li&gt;
&lt;li&gt;Solo SaaS founders with &amp;lt;1k users&lt;/li&gt;
&lt;li&gt;Local delivery apps, clinics, or automations that need recurring SMS&lt;/li&gt;
&lt;li&gt;IoT/sensor projects that send alerts&lt;/li&gt;
&lt;li&gt;Anyone who’s tired of “$0.something per SMS” adding up over time&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;How does it work?&lt;/strong&gt;&lt;br&gt;
SimGate connects to your phone via a mobile gateway app. Once paired, you can:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Send SMS using a secure API&lt;/li&gt;
&lt;li&gt;Avoid cloud provider markups&lt;/li&gt;
&lt;li&gt;Pay a flat monthly subscription instead of per message (free plan will be available as well)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This way, your phone becomes your own private SMS gateway.&lt;br&gt;
I’m keeping the first version lean — just enough to get real use cases working.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Want to try it?&lt;/strong&gt;&lt;br&gt;
I’ve opened up a waitlist to gather early interest and invite a few testers as soon as the MVP is live.&lt;/p&gt;

&lt;p&gt;If this solves a problem for you — or just sounds interesting — you can join here:&lt;br&gt;
👉 &lt;a href="https://www.simgate.app" rel="noopener noreferrer"&gt;https://www.simgate.app&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Thanks for reading — and if you’ve ever struggled with SMS pricing or built your own DIY solution, I’d love to hear your story in the comments!&lt;/p&gt;

&lt;p&gt;Nik&lt;br&gt;
&lt;a href="mailto:dev@simgate.app"&gt;dev@simgate.app&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
