<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Subhana on Medium]]></title>
        <description><![CDATA[Stories by Subhana on Medium]]></description>
        <link>https://medium.com/@subhanahuman?source=rss-28588d5df47------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>Stories by Subhana on Medium</title>
            <link>https://medium.com/@subhanahuman?source=rss-28588d5df47------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 20 Nov 2026 15:07:35 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@subhanahuman/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Algorithm is the end of humanity.]]></title>
            <link>https://medium.com/@subhanahuman/algorithm-is-the-end-of-humanity-d0b04d191db1?source=rss-28588d5df47------2</link>
            <guid isPermaLink="false">https://medium.com/p/d0b04d191db1</guid>
            <category><![CDATA[social-media]]></category>
            <category><![CDATA[internet]]></category>
            <category><![CDATA[thinking]]></category>
            <category><![CDATA[freedom]]></category>
            <category><![CDATA[humanity]]></category>
            <dc:creator><![CDATA[Subhana]]></dc:creator>
            <pubDate>Wed, 09 Jul 2025 12:35:04 GMT</pubDate>
            <atom:updated>2025-07-09T12:35:04.525Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-g1EQs2c1_kRcyXpOVR6gg.png" /></figure><p>It was June 2024. Not a busy day. I was casually scrolling over instagram as usual. Suddenly I saw a post about Rafah.</p><p>Wait.. do you want to leave reading Rafah. It’s not about Rafah, not that it will be wrong to write about it, but this one is not about that. Read along.</p><p>I ignored it. I know it is sad but me alone cannot do anything about it, I thought. I went back to scrolling. Another post, and another, and another.</p><p>Wait, what?</p><p>What happened?</p><p>I turned to google, and typed Rafah and switched to news. And there it was. I understood what it was about.</p><p>And I did what I could do, went back to scrolling with a long face. Later on the day, I saw some people posting stories with a template saying “All Eyes on Rafah”.</p><p>I saw one story, then next and next. And I gathered my courage and thought a lot of the people are adding it, if I also show my support may be I can go unnoticed.</p><p>Yeah don’t roll your eyes. I am always scared to post things, scared about the consequences.</p><p>Anyways, I did post that story.</p><p>Within few minutes, I got messages from two of my college friends.</p><p>They started arguing that what happened is just a consequence of what happened on October 7th, 2023.</p><p>Yeah that was sad. I was genuinely worried when I saw the news of October 7th.</p><p>But I cannot make anyone understand that because I did not post a story about it then. Or even if I did, they weren’t gonna believe me because I posted about Rafah now.</p><p>After talking to them for sometime, I understood that they were completely convinced that there was nothing wrong in what happened in Rafah or Palestine.</p><p>That got me wondering, these people used to be my fellow students, my friends, we attended the same college, met same kind of people, grew up in same country, same state, how is it possible that they feel so differently about something?</p><p>And that’s when it hit me. It is the INTERNET.</p><p>When I was a student, YouTube, Facebook, etc. were quite young. When I visited YouTube, I could see a variety of videos on my homepage. And most of the people saw the same homepage. If I played a song, the next song could be a newly released song, or another song from the same album or from the same artist. But it was not predictable.</p><p>But now, if I play a song, the next song is most likely a song that is being advertised or a song I watched after the current song last time I was on Youtube.</p><p>On instagram, I was scrolling and a trending reel related to single life came to my feed. I didn’t like it or comment on it, I just stayed till the end of those 10 seconds. And from then every time I opened Instagram, I am getting at least 10 post on that same idea.</p><p>Same thing happens with political view. If I liked a post based on so called left or right ideology, Instagram assures that I don’t get the opposite of what I just liked. Just by liking a post, it puts in that category. That’s the algorithm.</p><p>Forget about interacting with posts, even if you talk about something, let’s say you said to your mom that you are craving biryani. The next you open instagram or Facebook, you will see an advertisement for biryani restaurant.</p><p>Most of the people notice this, but they ignore it by saying it shows you what you like.</p><p>But it is not that simple, is it? It is creating gaps in the society.</p><p>Let’s take an example of a person going through heartbreak. They will see a dark depressing feed every time they visit instagram and they keep on engaging with those posts. Instagram suggests more and more related reels and the loop goes on. If they could have come out of their sadness in weeks without internet, they will take months with internet.</p><p>Same thing happens with political views. To some people, only a certain type of ideology is presented and to some others, the other ideology. Day by day their confidence in that ideology increases because of constant validation from the similar posts.</p><p>Very few people gather the courage to investigate the other side because our mind approves only what it likes. And once you start believing idea 1, idea 2 is automatically discarded by your mind.</p><p>Algorithm has snatched our right to choose the content we want. It does not give us the option to choose now. It will make you comfortable on the platform so you don’t want to leave.</p><p><strong>Beware, every second you spend online. Control it, instead of getting controlled by it.</strong></p><p>That’s it. That’s what I wanted to say.</p><p>Thanks for reading it till the end.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d0b04d191db1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Sending Files in mail as attachments in SFCC]]></title>
            <link>https://medium.com/@subhanahuman/sending-files-in-mail-as-attachments-in-sfcc-24f0702e0360?source=rss-28588d5df47------2</link>
            <guid isPermaLink="false">https://medium.com/p/24f0702e0360</guid>
            <category><![CDATA[mail]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[sfcc]]></category>
            <category><![CDATA[file-attachments]]></category>
            <category><![CDATA[salesforce-commerce-cloud]]></category>
            <dc:creator><![CDATA[Subhana]]></dc:creator>
            <pubDate>Sun, 11 Jun 2023 10:18:12 GMT</pubDate>
            <atom:updated>2023-06-15T07:28:56.246Z</atom:updated>
            <content:encoded><![CDATA[<h3>Attachments in mail ( SFCC )</h3><p>Last week I got a requirement from the client to give user an ability to upload files from the contact us form and those files need to be send in the mail along with other details to the support team. After some digging I came to an understanding that this is not provided in SFCC out of the box. If you have similar requirement these steps might help you.</p><p>The first step is to add the input file field for user to upload files</p><pre>&lt;input type=&quot;file&quot; id=&quot;&quot; name=&quot;&quot; accept=&quot;image/png, image/jpeg, image/jpg, application/pdf&quot; multiple /&gt;</pre><p>The attribute <em>multiple </em>will allow multiple files to be uploaded.</p><p>Please note that for allowing files to be submitted along with the form, we need to add enctype=”multipart/form-data” in the form like below</p><pre>&lt;form action=&quot;&quot; method=&quot;POST&quot; enctype=&quot;multipart/form-data&quot;&gt;</pre><p>Once input filed is added, user can upload files. Now we need to encode those files to base64. For encoding I have used <a href="https://developer.mozilla.org/en-US/docs/Web/API/FileReader">FileReader</a> API.</p><pre>function encodeToBase64(file) {<br>    const reader = new FileReader();<br>    reader.onloadend = () =&gt; {<br>        file.src = reader.result;<br>    };<br>  <br>    reader.readAsDataURL(file);<br>}<br><br>const fileInput = $(&#39;your selector&#39;);<br>// Encode files when uploaded<br>fileInput.on(&#39;change&#39;, (e) =&gt; {<br>    const files = e.target.files;<br>    if (files) {<br>        Array.prototype.forEach.call(files, encodeToBase64);<br>    }<br>});</pre><p>After this, we need to pass these files to the controller when form is submitted through ajax call. Please note that if a form contains files too, we can not pass it as json. We need to create a <a href="https://developer.mozilla.org/en-US/docs/Web/API/FormData">FormData</a> object for it.</p><pre>$(&#39;form&#39;).submit(function (e) {<br>    e.preventDefault();<br>    var form = new FormData($(this)[0])<br>    var inputFileField =$(&#39;your selector&#39;);<br>    var files = inputFileField.length ? inputFileField.prop(&#39;files&#39;) : null;<br><br>    if (files) {<br>        var fileObj = {};<br>        Array.prototype.forEach.call(files, function addToMap(file) {<br>            fileObj[file.name] = file.src;<br>        })<br><br>        if(fileObj) {<br>            form.append(&#39;your selector&#39;, JSON.stringify(fileObj));<br>        }<br>    }<br><br>     $.ajax({<br>        url: url,<br>        type: &#39;post&#39;,<br>        contentType: false,<br>        processData: false,<br>        data: form,<br>        success: function (data) {<br>            // do something<br>        },<br>        error: function (err) {<br>            // error message<br>        }<br>      });<br>});</pre><p>Once we have everything in the controller including a json object for files with file name as the key, we will create a map of files. Now we will create a map for all the things required to construct the mail and create a content which is <strong>MimeEncodedText </strong>by using the render method of dw.util.Template<strong>. </strong>Then we set that content in the mail and send the mail.</p><pre>base.sendWithAttachments = function sendWithAttachments(emailObj, template, context) {<br>    var Map = require(&#39;dw/util/HashMap&#39;);<br>    var Template = require(&#39;dw/util/Template&#39;);<br>    var Mail = require(&#39;dw/net/Mail&#39;);<br><br>    // Create the template that we will use to send the email.<br>    var template = new Template(&#39;template&#39;);<br><br>    if(context.files){<br>        context.files = processFiles(JSON.parse(context.files));<br>    }<br>    <br>    var mailAttributes = new Map();<br>    Object.keys(context).forEach(function (key) {<br>        mailAttributes[key] = context[key];<br>    });<br><br>    var mail = new Mail();<br>    // Render the template with the data in the Hash<br>    var content = template.render(mailAttributes);<br><br>    mail.addTo(emailObj.to);<br>    mail.setFrom(emailObj.from);<br>    mail.setSubject(emailObj.subject);<br>    <br>    if (&#39;cc&#39; in emailObj &amp;&amp; emailObj.cc) {<br>        mail.setCc(new ArrayList(emailObj.cc));<br>    }<br>    if (&#39;bcc&#39; in emailObj &amp;&amp; emailObj.bcc) {<br>        mail.setBcc(new ArrayList(emailObj.bcc));<br>    }<br><br>    mail.setContent(content);<br>    mail.send();<br>}<br>function processFiles(files) {<br>    var Map = require(&#39;dw/util/HashMap&#39;);<br>    <br>    var filesMap = new Map();<br>    Object.keys(files).forEach(function (key) {<br>        filesMap.put(key, files[key]);  <br>    });<br><br>    return filesMap;<br>}</pre><p>The structure of the template depends on what are all things we have in the mail. In my case I have to show some details filled by the user in a well structured format and attach some files. Therefore my template looks something like this.</p><pre>&lt;iscontent type=&quot;multipart/mixed; boundary=content-divider&quot; compact=&quot;false&quot; charset=&quot;ISO-8859-1&quot;&gt;--content-divider<br>Content-Type: multipart/alternative; boundary=mail-body-divider<br><br>--mail-body-divider<br>Content-Type: text/html; charset=utf-8<br>Content-Transfer-Encoding: quoted-printable<br><br>&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;<br>&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;<br>   &lt;head&gt;<br>      &lt;!-- Add styles or anything required here --&gt;<br>   &lt;/head&gt;<br>   &lt;body&gt;<br>      &lt;!-- Display all the content here --&gt;<br>   &lt;/body&gt;<br>&lt;/html&gt;<br><br>--mail-body-divider--<br>&lt;isif condition=&quot;${ !empty(pdict.files) }&quot;&gt;&lt;isloop items=&quot;${ pdict.files.keySet() }&quot; var=&quot;key&quot;&gt;<br>&lt;isset name=&quot;file&quot; value=&quot;${ pdict.files.get(key) }&quot; scope=&quot;page&quot;/&gt;<br>&lt;isset name=&quot;contentType&quot; value=&quot;${ file.substring(file.indexOf(&#39;:&#39;)+1, file.indexOf(&quot;;&quot;)) }&quot; scope=&quot;page&quot;/&gt;<br>&lt;isset name=&quot;fileContent&quot; value=&quot;${ file.replace(&#39;data:&#39;, &#39;&#39;).replace(/^.+,/, &#39;&#39;) }&quot; scope=&quot;page&quot;/&gt;<br>--content-divider<br>Content-Type: ${contentType}; name=&quot;${key}&quot;;<br>Content-Description: ${key}<br>Content-Disposition: attachment; filename=&quot;${key}&quot;; size=${fileContent.length}; creation-date=&quot;${(new Date()).toISOString()}&quot;; modification-date=&quot;${(new Date()).toISOString()}&quot;<br>Content-Transfer-Encoding: base64<br><br>${fileContent}&lt;/isloop&gt;<br>&lt;/isif&gt;--content-divider--</pre><p>In the template I have used a loop to attach all the files and inside the loop itself I have checked for content-type of each file. Because in my case user can attach pdf, png and jpeg files.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=24f0702e0360" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>